-
-
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
gh-107431: Make multiprocessing.managers.{DictProxy,ListProxy}
generic
#107433
Conversation
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.
Some small points:
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.
Thanks, LGTM! Will wait to see if Jelle has any objections before merging.
Previous additions of __class_getitem__
methods have been treated as features, so we probably can't backport this, unfortunately.
Hmm... I suppose one reason for not making these subscriptable at runtime might be that these are undocumented classes that aren't included in |
Maybe these classes should be documented? I'm also a bit hesitant about this if these classes are undocumented. |
@gpshead, any thoughts from you on this, as a multiprocessing expert? I think there's a decent case for documenting these classes, since instances of |
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, but i'm not a typing expert.
In case of doubt, I prefer to not document DictProxy and ListProxy. I don't think that not documenting these types should block this enhancement.
@JelleZijlstra: What do you think? @gvanrossum, @carljm (typing experts): Do you want to review this typing change? |
@vstinner, this needs input from multiprocessing experts, not typing experts. Two typing experts have already given their input here (Jelle and myself). From a typing perspective, the change is fine. But from a multiprocessing perspective: the classes are currently undocumented and not included in |
@pitrou: Do you have an opinion on this change? |
I don't think anyone wants to claim expertise for multiprocessing no matter how much we've done work on it. This change looks good to me, I made a couple edits. |
I have no idea what a |
Thanks for making _BaseDictProxy private. |
…` generic (python#107433) Make `multiprocessing.managers.{DictProxy,ListProxy}` generic for type annotation use. `ListProxy[str]` for example. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
…` generic (python#107433) Make `multiprocessing.managers.{DictProxy,ListProxy}` generic for type annotation use. `ListProxy[str]` for example. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
This looks like a reasonable use-case for generic types.
In
typeshed
they are generic:Fixes #107431.