Message356318
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). |
|
Date |
User |
Action |
Args |
2019-11-10 05:36:00 | gvanrossum | set | recipients:
+ gvanrossum, levkivskyi, Nils Kattenbeck |
2019-11-10 05:36:00 | gvanrossum | set | messageid: <1573364160.79.0.432616536657.issue38756@roundup.psfhosted.org> |
2019-11-10 05:36:00 | gvanrossum | link | issue38756 messages |
2019-11-10 05:36:00 | gvanrossum | create | |
|