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

Infer return None in stubgen #4181

Closed
czhang03 opened this issue Oct 31, 2017 · 1 comment
Closed

Infer return None in stubgen #4181

czhang03 opened this issue Oct 31, 2017 · 1 comment
Labels

Comments

@czhang03
Copy link

czhang03 commented Oct 31, 2017

Is it possible that when a function don't have any return statement, mypy can infer that the return type is None?

Both Pycharm and Typescript has this feature.

@gvanrossum
Copy link
Member

No, mypy's position is that the body must conform to the signature, not the other way around.

This would be a good feature for stubgen though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants