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

Guido van Rossum guido at python.org
Sun Jan 18 05:14:01 CET 2015

On Sat, Jan 17, 2015 at 1:58 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:

> BTW, I think namespaces naturally fix this issue. If all of the proposed
> type system lives either in the builtin namespace or in the "typing"
> module, then annotations and type hints from any other module namespace
> MUST simply be ignored by tools that don't understand them, and are also
> easy to ignore. Then you could write "x: typing.List[cython.int]", and
> static type checkers could still validate that all input for "x" is a list
> (of some unknown item type), and Cython could enforce that anything coming
> out of such a list at runtime can coerce to a C "int".

As I responded to your previous message, I think this can indeed be solved
very elegantly by providing a stub module for cython that equates cython.int
with typing.Any.

--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150117/e8e4c2a6/attachment.html>

More information about the Python-ideas mailing list