◐ Shell
clean mode source ↗

Message 380852 - Python tracker

> Does anyone know why the treatment of unresolved references was changed in 3.9?

Probably to prepare for 3.10, where `from _future__ import annotations` is the default.

> 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" forward reference for the _() method?

I don't know -- you might want to look through the source code of singledispatch. Maybe the flow through the initial decorator is different than the flow through register().