Status of optional static typing in Python?

Kay Schluehr kay.schluehr at gmx.net
Thu Jun 22 16:43:36 EDT 2006


Christian Convey wrote:
> Hi guys,
>
> I'm looking at developing a somewhat complex system, and I think some
> static typing will help me keep limit my confusion.  I.e.:
>
> http://www.artima.com/weblogs/viewpost.jsp?thread=87182
>
> Does anyone know if/when that feature may become part of Python?
>
> Thanks very much,
> Christian

It was discussed recently at the Python 3000 mailing list and it seems
that the goals are not very ambitious but this was already clear from
Guidos Artima blog post you cited. So it may happen that type
annotation syntax in function signatures will be introduced in Py3K but
the semantics is reduced to a "protocol" i.e. Python will still be
untyped in a strict sense ( or dynamically type checked to put it more
positive ).

An proposed alternative for type annotation syntax and runtime
type-checks that comes up from time to time is using decorators for
this job.

Here is a recipe that might be usefull in your project right now:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/426123

Regards,
Kay




More information about the Python-list mailing list