Skip to content

gh-91491: What's New in 3.11 section for typing PEPs - #91721

Merged
JelleZijlstra merged 4 commits into
python:mainfrom
JelleZijlstra:typingwhatsnew
Apr 24, 2022
Merged

JelleZijlstra merged 4 commits into
python:mainfrom
JelleZijlstra:typingwhatsnew

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Apr 20, 2022 •

Copy link
Copy Markdown
Member

Other aspects of typing aren't covered yet; I'll do that in a
separate PR.

#91491

Other aspects of typing aren't covered yet; I'll do that in a
separate PR.
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting core review labels Apr 20, 2022
@JelleZijlstra

Copy link
Copy Markdown
Member Author

cc PEP authors @davidfstr @mrahtz @pradeep90 @Gobot1234

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM but I'm not an expert authority on the PEPs listed. So I'm waiting for them to give their reviews.

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated

@Gobot1234 Gobot1234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Self section looks good, thanks Jelle.

Comment thread Doc/whatsnew/3.11.rst Outdated

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits, but on the whole this looks great!

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated

@davidfstr davidfstr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some wordsmithing comments. Thanks for drafting @JelleZijlstra !

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
@JelleZijlstra

Copy link
Copy Markdown
Member Author

Thanks everyone for the feedback! I pushed a commit addressing most requests and adding some links.

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

Comment thread Doc/whatsnew/3.11.rst

@pradeep90 pradeep90 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst
def __enter__(self) -> Self:
self.lock()
return self

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One important use case is that calling this method on a subclass object will return the subclass type, not this class type. e.g.,

class ChildLock(MyLock): ...

ChildLock().__enter__()  # type is `ChildLock`, not `MyLock`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think that should be mentioned here? It's meant to be a brief summary after all.

Comment thread Doc/whatsnew/3.11.rst Outdated
@mrahtz

mrahtz commented Apr 21, 2022

Copy link
Copy Markdown
Contributor

LGTM. Thanks, Jelle!

Co-authored-by: Pradeep Kumar <gohanpra@gmail.com>
@JelleZijlstra
JelleZijlstra merged commit dd3cf12 into python:main Apr 24, 2022
@JelleZijlstra
JelleZijlstra deleted the typingwhatsnew branch April 24, 2022 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news topic-typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants