[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-12 Thread Ryan Sobol
Ryan Sobol added the comment: Also, I'm a bit puzzled about something from the previously mentioned Integer class and its use of __future__.annotations. Why isĀ it possible to declare an Integer return type for the add() method, but only possible to declare an "Integer" forwar

[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-12 Thread Ryan Sobol
Ryan Sobol added the comment: Does anyone know why the treatment of unresolved references was changed in 3.9? -- ___ Python tracker <https://bugs.python.org/issue41

[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-10-29 Thread Ryan Sobol
Ryan Sobol added the comment: It's worth pointing out that a similar error is produced for a forward-referenced return type of a registered method, but only for python3.9. For example: from __future__ import annotations from functools import singledispatchmethod class Integer: