[issue46333] ForwardRef.__eq__ does not respect module parameter

Andreas H. report at bugs.python.org
Wed Jan 12 11:26:23 EST 2022


Andreas H. <ahangauer at gmx.net> added the comment:

Ah, let me add one point: PEP563  (-> `from __future__ import annotations`) is also not helping. 

Even with PEP563 enabled, the JSON example  

   Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ]

needs to be written in exact the same way as without PEP563. In other words there are cases where `ForwardRef` cannot be avoided. And unforntunately these are the cases where we have the ForwardRef missing context issue.

----------

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


More information about the Python-bugs-list mailing list