Python is DOOMED! Again!

Ian Kelly ian.g.kelly at gmail.com
Thu Jan 22 22:24:36 CET 2015


On Thu, Jan 22, 2015 at 7:16 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
>> Meanwhile, there's the strange decision to implement type hints for
>> local variables # comment lines. I have an hard time wrapping my head
>> around this one. Really, comments!?
>
> Yes, really. There is plenty of prior art for machine-meaningful comments:
>
> - mypy uses it, and it works fine
> - Pascal uses {$ ...} compiler directives
> - Unix uses a special hash-bang #! comment in the first line to
>   specify the executable that runs the script
> - Python supports a special encoding declaration using #
> - doctest uses comments for directives
> - HTML puts code (Javascript usually) inside of comments
> - JMSAssert for Java uses comments for design-by-contract assertions

Perhaps even more relevant to PEP 484:

- The Closure compiler for Javascript uses JSDoc tags in comments for
static typing and analysis.



More information about the Python-list mailing list