El vie, 16 abr 2021 a las 21:32, Christopher Barker (<[email protected]>) escribió:
> ... > 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 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.
_______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/BGC5WTYMO5EQBBNNR2YNZRJZHX5O3AH6/ Code of Conduct: http://python.org/psf/codeofconduct/
