Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adoption of Final Qualifier in SymPy Classes #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sylee957
Copy link
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
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
Member

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

@sylee957
Copy link
Member Author

you can always silence the type checker

@oscarbenjamin
Copy link
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