[Python-ideas] Type Hinting Kick-off
Guido van Rossum
guido at python.org
Sat Dec 20 01:55:37 CET 2014
A few months ago we had a long discussion about type hinting. I've thought
a lot more about this. I've written up what I think is a decent "theory"
document -- writing it down like this certainly helped *me* get a lot of
clarity about some of the important issues.
I should thank Jeremy Siek for his blog post about Gradual Typing, Jukka
Lehtosalo for mypy (whose notation I am mostly borrowing), and Jim Baker
for pushing for an in-person meeting where we all got a better
understanding of several issues.
There's also a PEP draft, written by Łukasz Langa and revised by him based
on notes from the above-mentioned in-person meeting; unfortunately it is
still a bit out of date and I didn't have time to update it yet. Instead of
working on the PEP, I tried to implement a conforming version of typing.py,
for which I also ran out of time -- then I decided to just write up an
explanation of the theory.
I am still hoping to get a PEP out for discussion in early January, and I
am aiming for provisional acceptance by PyCon Montréal, which should allow
a first version of typing.py to be included with Python 3.5 alpha 4. If you
are wondering how I can possibly meet that schedule: (a) the entire runtime
component proposal can be implemented as a single pure-Python module: hence
the use of square brackets for generic types; (b) a static type checker is
not part of the proposal: you can use mypy, or write your own.
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas