does lack of type declarations make Python unsafe?

Moshe Zadka m at moshez.org
Mon Jun 16 17:00:22 CEST 2003


On Mon, 16 Jun 2003, "Terry Reedy" <tjreedy at udel.edu> wrote:

> If one considers the set of values as part of the type, this amounts
> to saying that the type system of most languages is too coarse for
> real needs.  Many operations need counts [0, 1, 2, ...].  Python does
> not have this, C only backhandedly (unsigned int, like calling an int
> an unfractionated rational).  A few need a count subset: circular
> queues need residue classes [0, 1, ..., n-1] with all operation
> results taken %n.  These are well-defined mathematical sets that
> programmers usually have to simulate rather than simply declare.

Sure...
Some operations need primes (e.g., RSA encryption). Some operation
need strings which specify programs which halt (think "exec" :).
Of course, if you push too much into the typing system, than the type
system becomes undecidable. A language where the compiler only warns
about a subset of the typing violations is not much better than a language
whose type system is a subset of the real system.
-- 
Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
Agile Programming Language -- http://www.python.org/





More information about the Python-list mailing list