Skip to content

Remove raise statements from function bodies#3355

Merged
srittau merged 1 commit intopython:masterfrom
srittau:remove-raise
Oct 13, 2019
Merged

Remove raise statements from function bodies#3355
srittau merged 1 commit intopython:masterfrom
srittau:remove-raise

Conversation

@srittau
Copy link
Collaborator

@srittau srittau commented Oct 13, 2019

While it may eventually be useful to mark the exceptions that can be
raised from a function or method, the semantics are currently undefined
and unclear.

While it may eventually be useful to mark the exceptions that can be
raised from a function or method, the semantics are currently undefined
and unclear.
@sproshev
Copy link
Contributor

What do you think about improving the semantics instead of dropping raise statements? I'm not sure if they disturb someone.

@srittau
Copy link
Collaborator Author

srittau commented Oct 13, 2019

Semantics need to be defined. This is outside the scope of typeshed. The current raise statements could contradict the proposed semantics and then be a liability. Some type checkers cold decide to experiment with raise statements. The existing annotations could interfere with that. Also, since they are currently only used by very few files, it is likely that they get outdated and won't match reality. Finally, they are not checked by any of our CI tests, so errors are likely not to be caught.

@srittau srittau merged commit de26a3d into python:master Oct 13, 2019
@srittau srittau deleted the remove-raise branch October 13, 2019 19:51
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.

3 participants