Repository navigation
gh-91491: What's New in 3.11 section for typing PEPs - #91721
Conversation
Other aspects of typing aren't covered yet; I'll do that in a separate PR.
|
cc PEP authors @davidfstr @mrahtz @pradeep90 @Gobot1234 |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
This LGTM but I'm not an expert authority on the PEPs listed. So I'm waiting for them to give their reviews.
Gobot1234
left a comment
There was a problem hiding this comment.
The Self section looks good, thanks Jelle.
AlexWaygood
left a comment
There was a problem hiding this comment.
A few nits, but on the whole this looks great!
davidfstr
left a comment
There was a problem hiding this comment.
Added some wordsmithing comments. Thanks for drafting @JelleZijlstra !
|
Thanks everyone for the feedback! I pushed a commit addressing most requests and adding some links. |
| def __enter__(self) -> Self: | ||
| self.lock() | ||
| return self | ||
|
|
There was a problem hiding this comment.
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`.
There was a problem hiding this comment.
Do you think that should be mentioned here? It's meant to be a brief summary after all.
|
LGTM. Thanks, Jelle! |
Co-authored-by: Pradeep Kumar <gohanpra@gmail.com>
Other aspects of typing aren't covered yet; I'll do that in a
separate PR.
#91491