Alexander Mohr <thehes...@gmail.com> added the comment:

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 ;)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36009>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to