Detect whether a method is abstract or always raise an exception #860
Labels
astbuilder
A substantive change is required in the astbuilder flow in order to fix this issue
enhancement
Abstract methods and methods unconditionally raising exceptions should be handled specially because
we should not invite developers to use them directly.
This can be done by adding a special note for instance.
Also, these methods should not be shown in the constructors list on the header of class pages.
Examples of method that should be considered abstract:
Mypy implemementation: https://github.com/python/mypy/blob/v1.13.0/mypy/semanal.py#L7550
We can do roughly the same.
Other interesting mypy code fragments:
https://github.com/python/mypy/blob/52888aec43ef8ba59645c7cd3ff5725ff9a861d7/mypy/checkexpr.py#L6234
https://github.com/python/mypy/blob/52888aec43ef8ba59645c7cd3ff5725ff9a861d7/mypy/semanal_classprop.py#L42
The text was updated successfully, but these errors were encountered: