[Python-ideas] Proposal: Use mypy syntax for function annotations
Stefan Krah
stefan at bytereef.org
Sat Aug 16 13:01:56 CEST 2014
Ethan Furman <ethan at stoneleaf.us> wrote:
> On 08/15/2014 10:04 PM, Steven D'Aprano wrote:
> >Using docstring annotations splits the information about parameters into
> >two places. Those two places might be close, but there are still two
> >sources of ultimate truth instead of one. You have the name of the
> >parameter in the parameter list, and the type of the parameter inside
> >the docstring separated by some arbitrary number of lines of code.
>
> You say that like it's a bad thing. Not having everything crammed
> into one spot can be good. Too dense is just as bad as too sparse.
It *is* a bad thing. ;) Humans can recognize patterns easily, and Steven's
example can be understood at a single glance.
The information is declarative and the density isn't that high. Density
may become a problem if the information is functional and dense, like in
APL. Even that can be overcome by training.
Stefan Krah
More information about the Python-ideas
mailing list