Message335675
I'm not a typing expert, but from what I understand you could do:
class Bar: pass
foo: Callable[[], Bar] = weakref.ref(Bar())
but you lose the typing weakref.ref.
OTOH if you simply do:
foo: weakref.ref = weakref.ref(Bar())
you lose the info of Bar ;) |
|
Date |
User |
Action |
Args |
2019-02-16 08:30:42 | thehesiod | set | recipients:
+ thehesiod, gvanrossum, levkivskyi |
2019-02-16 08:30:42 | thehesiod | set | messageid: <1550305842.57.0.713341381101.issue36009@roundup.psfhosted.org> |
2019-02-16 08:30:42 | thehesiod | link | issue36009 messages |
2019-02-16 08:30:42 | thehesiod | create | |
|