Skip to content

Conversation

@stroxler
Copy link
Contributor

We decided to add this for two reasons:

  • It was specifically requested by the author of the overrides library, because there there are some handy runtime uses of override information (such as propagating docstrings, which we highlight as a concrete example)
  • We realized that we actually added __final__ to @typing.final in spite of it not being specified in PEP 591, which we felt strongly suggests that even if we omit it we would later change our minds.

This runtime behavior is currently implemented in typing_extensions (see python/typing_extensions#86) as well as pyre_extensions.

I ran pre-commit, it looks like there are no lint errors

We decided to add this for two reasons:

- It was specifically requested by the author of the `overrides`
  library, because there there are some handy runtime uses
  of override information (such as propagating docstrings, which
  we highlight as a concrete example)
- We realized that we actually added `__final__` to
  `@typing.final` in spite of it not being specified in PEP 591,
  which we felt strongly suggests that even if we omit it we
  would later change our minds.

This runtime behavior is currently implemented in typing_extensions
(see python/typing_extensions#86) as well
as pyre_extensions.
@JelleZijlstra JelleZijlstra merged commit 37a5ea8 into python:main Oct 28, 2022
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.

2 participants