You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is impossible because the @final decorator is a no-op at runtime: https://github.com/python/cpython/blob/main/Lib/typing.py#L2030. I'm thinking of proposing a change to CPython for 3.11 to make the decorator add .__final__ = True to decorated functions or classes. Then we can backport that change to typing-extensions.
Classes annotated with
@final
should not allow subclasses, and methods decorated with@final
should not allow overrides.The text was updated successfully, but these errors were encountered: