-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Description
Feature or enhancement
Proposal:
#19425 made the internal file wrapper mailbox._ProxyFile generic, probably because it was generic over AnyStr in typeshed. (Unchanged since mailbox.pyi was added in python/typeshed#3427. There was no discussion about it back then.)
_ProxyFile does not need to be generic, as it's only used internally by mailbox.py and is always initialized with a binary file object (as returned by open()). In fact, this now complicates the stubs for mailbox.pyi, because we need to carry the generic-ness of this class through to other protocols. See python/typeshed#14950 for details.
I suggest to remove __class_getitem__ again, although this probably needs to go through the deprecation process, even though this is an internal class?
Cc @emmatyping @JelleZijlstra @AlexWaygood
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response