[issue46669] Add types.Self

Raymond Hettinger report at bugs.python.org
Mon Feb 7 12:27:50 EST 2022


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

On a related note, is this the correct way to annotate __exit__?


Exc = TypeVar('Exc', bound=Exception)

def __exit__(self, exctype: Optional[Type[Exc]], excinst: Optional[Exc], exctb: Any) -> None:

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46669>
_______________________________________


More information about the Python-bugs-list mailing list