
April 17, 2021
1:56 p.m.
... dataclasses may be the only part of the stdlib that uses annotations.
There's another one, actually: functools.singledispatch, at https://github.com/python/cpython/blob/3.9/Lib/functools.py#L860. It uses
El vie, 16 abr 2021 a las 21:32, Christopher Barker (<pythonchb@gmail.com>) escribió: the annotations on the first argument to an `@register`ed function to figure out how to dispatch. Currently it uses `typing.get_type_hints` to get the type. Presumably, this would break with PEP 563 semantics if you try to create a singledispatch function in a nested namespace.