PEP 3107 and stronger typing (note: probably a newbie question)

Kay Schluehr kay.schluehr at gmx.net
Thu Jun 21 13:53:33 EDT 2007


On Jun 20, 8:53 pm, Stephen R Laniel <s... at laniels.org> wrote:

> Reading [1], I wonder: why isn't the compiler making better
> use of (purely optional) type labeling? Why not make a compiler
> directive so that
>
> a) it will check the types of all my arguments and return
>    values, and maybe even
> b) do some type inference up the call stack?

That's simply because no one knows about the effects it has on Pythons
programming practices. Hence it is outsourced to "3rd party packages"
and these can be x-compilers as well that do all the inference stuff
and translate to Pyrex, C++, D or any other language having an
appropriate bridge. This stuff is simply beyond Python 3.0 and might
be addressed in subsequent versions such as Python 3.1 or Python 3.2
when experiences are collected with different "annotations handlers".




More information about the Python-list mailing list