Ivan Levkivskyi <levkivs...@gmail.com> added the comment:

Yes, this is as expected. A recommended workaround is to define a type alias 
like `Match = re.Match` before the class body. You can also suppress the 
exception with `from __future__ import annotations` (so that the annotations 
are not evaluated), but static type checkers like mypy will still force you to 
use the alias.

----------
nosy: +levkivskyi
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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

Reply via email to