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

David Mertz mertz at gnosis.cx
Sun Jan 18 23:18:02 CET 2015

It occurs to me that it wouldn't be that difficult to create a tool called
'python-annotations-to-cython' (maybe a shorter name like 'py2pyx') that
would take whatever type annotation information was contained in a .py file
and generate a .pyx file with cython types added in.

On Sun, Jan 18, 2015 at 12:46 PM, Andrew Barnert <
abarnert at yahoo.com.dmarc.invalid> wrote:

> 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.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150118/cfc84785/attachment.html>

More information about the Python-ideas mailing list