[Python-ideas] Move optional data out of pyc files

Erik Bray erik.m.bray at gmail.com
Wed Apr 11 09:39:28 EDT 2018


On Tue, Apr 10, 2018 at 9:50 PM, Eric V. Smith <eric at trueblade.com> wrote:
>
>>> 3. Annotations. They are used mainly by third party tools that
>>> statically analyze sources. They are rarely used at runtime.
>>
>> Even less used than docstrings probably.
>
> typing.NamedTuple and dataclasses use annotations at runtime.

Astropy uses annotations at runtime for optional unit checking on
arguments that take dimensionful quantities:
http://docs.astropy.org/en/stable/api/astropy.units.quantity_input.html#astropy.units.quantity_input


More information about the Python-ideas mailing list