Skip to content

Use explicit Optional[] on argument types with default None #1420

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

Merged
merged 1 commit into from
Jun 20, 2017

Conversation

gvanrossum
Copy link
Member

I'm sure there are many more like this, but this one drew my attention (maybe because it's part of the initial import cycle).

@matthiaskramm
Copy link
Contributor

Are we rowing back on the x : t = None shorthand?

@gvanrossum
Copy link
Member Author

Yes, there's some discussion in python/typing#275, and in mypy we now have python/mypy#3248 (--no-implicit-optional). It's going to be tough to actually roll back this behavior, because of the sheer amount of code (e.g. in typeshed) that depends on it. But there's at least agreement that this was a mistake when PEP 484 was accepted.

@matthiaskramm matthiaskramm merged commit 3025609 into master Jun 20, 2017
@matthiaskramm matthiaskramm deleted the fix-optional-default branch June 20, 2017 23:30
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