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

[feature request] option to assume None as return type #12695

Closed
beauxq opened this issue Apr 29, 2022 · 5 comments
Closed

[feature request] option to assume None as return type #12695

beauxq opened this issue Apr 29, 2022 · 5 comments
Labels

Comments

@beauxq
Copy link

beauxq commented Apr 29, 2022

Feature

an option to assume None as the return type if there is no return type annotation

(With this option, disallow-untyped-defs would only make sure all parameters are typed.)

Pitch

Putting -> None on every function that doesn't return a value adds a lot of clutter, but it's required in order to enforce that all the parameters are typed.

(And making sure all the parameters are typed is required to get all of the available static typing analysis benefits.)

@beauxq beauxq added the feature label Apr 29, 2022
@AlexWaygood
Copy link
Member

Duplicate of #10149

@beauxq
Copy link
Author

beauxq commented Apr 29, 2022

@AlexWaygood That is not at all the feature that I'm requesting.

I don't want it to infer anything.

I want it to always just assume None for the return type if there is no return type annotation.

This would still require the annotation for any other return type.

@AlexWaygood
Copy link
Member

AlexWaygood commented Apr 29, 2022

Okay, I suppose this functionality could be implemented behind a flag. Apologies for the misdiagnosis :)

I think it's highly unlikely that this functionality will be implemented, though, unless you'd like to submit a PR to make it happen (and even then, nothing's guaranteed; new flags generally aren't added lightly).

@AlexWaygood AlexWaygood reopened this Apr 29, 2022
@pranavrajpal
Copy link
Contributor

This looks like a duplicate of #9413.

@AlexWaygood
Copy link
Member

This looks like a duplicate of #9413.

Yup. Thanks @pranavrajpal.

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