-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-34336: Don't promote possibility to leave out typing.Optional #8677
Conversation
Doc/library/typing.rst
Outdated
@@ -988,13 +988,6 @@ The module defines the following classes, functions and decorators: | |||
|
|||
``Optional[X]`` is equivalent to ``Union[X, None]``. | |||
|
|||
Note that this is not the same concept as an optional argument, | |||
which is one that has a default. An optional argument with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the first sentence (i.e. Note that this is not the same concept as an optional argument, which is one that has a default.
). You might also add examples, e.g. def (arg: int = 0)
vs. def foo(a: Optional[int] = None)
.
Ok, left that in and rephrased the rest of the paragraph to use the suggested examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm not sure if this deserves a news item -- I'd think not (it's just a minor documentation tweak) but another core dev can decide.
I don't see any need for a news entry. |
@ilevkivskyi: Please replace |
Hm, I also forgot to add backport labels. @scop will you have time to make manual backports to 3.6 and 3.7? Thanks! (If no, then I can do this.) |
@ilevkivskyi you can still add the backport labels after merge and see if it will backport cleanly. |
Oh, wow, I didn't know. Thank you Mariatta! |
Thanks @scop for the PR, and @ilevkivskyi for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Thanks @scop for the PR, and @ilevkivskyi for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-8679 is a backport of this pull request to the 3.6 branch. |
…thonGH-8677) (cherry picked from commit 336c945) Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
GH-8680 is a backport of this pull request to the 3.7 branch. |
…thonGH-8677) (cherry picked from commit 336c945) Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
https://bugs.python.org/issue34336