On Friday, January 23, 2015 at 2:55:38 AM UTC+5:30, Ian wrote: > On Thu, Jan 22, 2015 at 7:16 AM, Steven D'Aprano 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.
I have not studied this carefully... so no opinion However Peyton Jones is known to have said that for Haskell, Haskell is on a Damas-Milner cusp -- basically if haskell's type system becomes any more sophisticated, then automatic type inference becomes undecidable http://repository.upenn.edu/cgi/viewcontent.cgi?article=1336&context=cis_papers Personally I find the predecessor of Haskell, gofer, prettier than Haskell precisely because Haskell's type system has become too 'clever': See my answer http://stackoverflow.com/questions/25855507/are-typeclasses-essential What has all this to do with python?? Dunno Just that the 'optionality' of type-hinting may not be quite straightforward ================ PS Ian for a hot thread like this its good to put quotes carefully You are quoting Steven quoting somebody -- dunno who that somebody is -- https://mail.python.org/mailman/listinfo/python-list