Creating type evaluation annotation
tjreedy at udel.edu
Sun Dec 9 15:50:58 EST 2018
On 12/9/2018 11:37 AM, Jon Ribbens wrote:
> On 2018-12-09, Marek Mosiewicz <marek.mosiewicz at jotel.com.pl> wrote:
>> I'm talking about this https://docs.python.org/3/library/typing.html
>> I'm not talking about new language. I think it could be nice to have
>> standard PEP annotations for classes to make type validation or type
>> hints when writing code.
>> This class valiadtors would be optional and run only when developer
>> wants to validate or write code, not in production as it is heavy.
> Yes, I think that's exactly what http://www.mypy-lang.org/ is.
> It is not a new language,
All libraries extend the language by adding names that python
recognizes. The typing additions are more like a new sublanguage than
most in that the new objects are not for computation in the traditional
sense but for representation of concepts.
Mypy recognizes this sublanguage to 'compute' whether calls conform to
the defined interfaces.
> despite the rather strange choice of domain name for it.
mypy.org is a 'parked' domain name for sale.
mypy.com is a misc tech news site (nothing about Python) dead since Jan
I don't know the genesis of the names above, but 'mypy' is a rather
obvious contraction of 'my py'(thon). I once had a directory of my
python scripts called 'mypy', in a directory on sys.path, so I could run
one with "python -m mypy.scriptname. I changed my name to not conflict.
Terry Jan Reedy
More information about the Python-list