This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients Nils Kattenbeck, gvanrossum, levkivskyi
Date 2019-11-10.05:36:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573364160.79.0.432616536657.issue38756@roundup.psfhosted.org>
In-reply-to
Content
Well, in typeshed, weakref.WeakSet and the others are generic, so you should be able to write

  from __future__ import annotations

  from weakref import WeakSet

  users: WeakSet[User]

Or if you need to support Python versions < 3.7, you could write

  users: 'WeakSet[User]'

Does that not solve your problem? It would be easier than adding yet another random class (or classes) to typing, which won't work for Python < 3.9 because typing.py is in the stdlib (and PEP 484 is no longer provisional).
History
Date User Action Args
2019-11-10 05:36:00gvanrossumsetrecipients: + gvanrossum, levkivskyi, Nils Kattenbeck
2019-11-10 05:36:00gvanrossumsetmessageid: <1573364160.79.0.432616536657.issue38756@roundup.psfhosted.org>
2019-11-10 05:36:00gvanrossumlinkissue38756 messages
2019-11-10 05:36:00gvanrossumcreate