Skip to content

Adoption of Final Qualifier in SymPy Classes#5

Open
sylee957 wants to merge 1 commit intosympy:mainfrom
sylee957:final
Open

Adoption of Final Qualifier in SymPy Classes#5
sylee957 wants to merge 1 commit intosympy:mainfrom
sylee957:final

Conversation

@sylee957
Copy link
Copy Markdown
Member

I don't think that this may need separate SymPEP because it is highly relevant with
#4,
but this was originally asked for,
and I'm trying to add this because we may align with Python PEPs one-to-one.

@moorepants
Copy link
Copy Markdown
Member

Is this proposal to request a general permission to use the @final decorator? Or is it about wanting to add that decorator to some specific existing methods in SymPy's (core) classes?

@asmeurer
Copy link
Copy Markdown
Member

Is there a way to override the final decorator if you know what you are doing?

@sylee957
Copy link
Copy Markdown
Member Author

you can always silence the type checker

@oscarbenjamin
Copy link
Copy Markdown
Contributor

Is there a way to override the final decorator

The decorator has no runtime effect. You can still subclass a class that is marked as final but editors, typecheckers etc would warn about it.

If someone would like to do it anyway but wants to use e.g. mypy then they would need to add type: ignore to silence the type checker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants