# C[omp]ute

Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

© 2006-2013 Andrew Cooke (site) / post authors (content).

## More Readable "Types in Python"

From: andrew cooke <andrew@...>

Date: Tue, 10 May 2011 08:38:28 -0400

Over the weekend (and during breakfast this morning!) I've made some major
changes to the pytyp paper.  It is, I hope much more clearer about what I am
trying to do.

In particular, since version 0.15, is has a "summary" that is a non-technical
review of the work:

ABCs [#]_ and type annotations are recent additions to the Python language.
ABCs let programmers describe the kind of data they have in their programs.
Type annotations associate these descriptions with particular variables.  So
then use that information, through functions like isinstance() and
issubclass(), when the program runs.

This paper describes work to provide more detailed descriptions: instead of
saying "this is a list" you can say "this is a list of integers", for
example.  It also describes ways that this information can be used: to check
that the description matches the data, perhaps, or to indicate that
different functions are called depending on the function arguments.

To do all this in a clear, consistent way, I use ideas from "type systems"
in other languages.  But that does not mean that I am adding such a system
to Python; I am simply using the other languages to help decide how best to
describe the data.  The end result stays true to the idea that Python is
"dynamically typed".

.. [#] Abstract Base Classes

As ever, the paper is at http://www.acooke.org/pytyp.pdf (and is still
incomplete - although I hope the underlying implementation is now final).

Andrew

PS Test of uni­code non­breaking space.