Hello, after being told in issue 38756 of the python bug tracker that PEP 585 will add generic typing to many standard collections/containers I looked at which types will get generic versions. I noticed that collections from weakref were not included (WeakDictionary, WeakSet etc). WeakKeyDictionary and WeakValueDictionary should probably automatically be generic as they extend _collections_abc.MutableMapping but WeakSet does not. Would it be possible to clarify that WeakDictionaries or subclasses in general will become generic but more importantly I think it should be worth considering add WeakSet to the PEP I would like to hear your thoughts on this topic... Greetings Nils Kattenbeck
FWIW WeakSet will be registered as MutableSet in 3.9. On Mon, Nov 11, 2019 at 7:06 AM Nils Kattenbeck <nilskemail@gmail.com> wrote:
Hello,
after being told in issue 38756 of the python bug tracker that PEP 585 will add generic typing to many standard collections/containers I looked at which types will get generic versions. I noticed that collections from weakref were not included (WeakDictionary, WeakSet etc). WeakKeyDictionary and WeakValueDictionary should probably automatically be generic as they extend _collections_abc.MutableMapping but WeakSet does not. Would it be possible to clarify that WeakDictionaries or subclasses in general will become generic but more importantly I think it should be worth considering add WeakSet to the PEP
I would like to hear your thoughts on this topic...
Greetings Nils Kattenbeck _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
Maybe it makes sense to add a note in the PEP saying this is not an exclusive list and some more classes can be made generic in the future if needed, but this is almost obvious, so I think it is up to the PEP author. -- Ivan On Mon, 11 Nov 2019 at 16:50, Guido van Rossum <guido@python.org> wrote:
FWIW WeakSet will be registered as MutableSet in 3.9.
On Mon, Nov 11, 2019 at 7:06 AM Nils Kattenbeck <nilskemail@gmail.com> wrote:
Hello,
after being told in issue 38756 of the python bug tracker that PEP 585 will add generic typing to many standard collections/containers I looked at which types will get generic versions. I noticed that collections from weakref were not included (WeakDictionary, WeakSet etc). WeakKeyDictionary and WeakValueDictionary should probably automatically be generic as they extend _collections_abc.MutableMapping but WeakSet does not. Would it be possible to clarify that WeakDictionaries or subclasses in general will become generic but more importantly I think it should be worth considering add WeakSet to the PEP
I would like to hear your thoughts on this topic...
Greetings Nils Kattenbeck _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...> _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
participants (3)
-
Guido van Rossum
-
Ivan Levkivskyi
-
Nils Kattenbeck