[Python-ideas] PEP 484 (Type Hints) -- first draft round

Andrew Barnert abarnert at yahoo.com
Sun Jan 18 21:46:35 CET 2015

On Jan 18, 2015, at 11:39, Chris Barker <chris.barker at noaa.gov> wrote:

> I guess the gist here is that I think if Python is going to have an official type hinting system, it should leave the door open to compile time and run-time type checking. A good test case might be: can it be used for Cython? But this thread seems to be indicating that that is not the goal, and indeed, that it's almost an anti-goal. I hope I'm wrong about that.

The impression I get--and I hope this isn't just wishful thinking--is that this is an anti-goal for v1 (Python 3.5), but it's very much a goal for v2 (some future version).

The issue is that it's a vague and ill-defined goal at the moment. So, there's a tactical argument that explicitly putting all of that off the table, and designing the simplest thing that could work for some purpose (a static type checker) now, is a better way to get to that long-term goal.

Meanwhile, the door is open for people to experiment with fitting Cython C types and ORM column types and all kinds of other things into the system, or using it for hinting a static or JIT optimizer, or anything else. Most likely people who try that will find big gaps that they need filled--and that's exactly how we're going to find out what's needed for the v2 type annotation system.

More information about the Python-ideas mailing list