does lack of type declarations make Python unsafe?

Aahz aahz at
Thu Jun 19 16:37:44 CEST 2003

[As usual, Alex demonstrates his logorrhea right before he has to vanish
on a long trip.  ;-)  I was unable to read the whole thing, but managed
to get far enough to nitpick something.]

In article <pNfIa.206219$g92.4232233 at>,
Alex Martelli  <aleax at> wrote:
>In Python one generally identifies (just as informally) a container as
>"an object which has a length" (using "length", perhaps a suboptimal
>choice of wording, to mean "number of items currently contained") and
>simultaneously express both 'c is a container' and 'that container is
>not empty' by
>    assert len(c)

Hmmmm....  I would only do that for a sequence.  From my POV, classes,
class instances (even those not implementing any special methods), and
modules all serve as containers for the purpose of determining what an
appropriate "container object" is for any particular program.
Aahz (aahz at           <*>

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra

More information about the Python-list mailing list