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 thehesiod
Recipients gvanrossum, levkivskyi, thehesiod
Date 2019-02-16.08:30:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550305842.57.0.713341381101.issue36009@roundup.psfhosted.org>
In-reply-to
Content
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 ;)
History
Date User Action Args
2019-02-16 08:30:42thehesiodsetrecipients: + thehesiod, gvanrossum, levkivskyi
2019-02-16 08:30:42thehesiodsetmessageid: <1550305842.57.0.713341381101.issue36009@roundup.psfhosted.org>
2019-02-16 08:30:42thehesiodlinkissue36009 messages
2019-02-16 08:30:42thehesiodcreate