does lack of type declarations make Python unsafe?

Anton Vredegoor anton at
Sun Jun 29 15:53:12 CEST 2003

kamikaze at (Mark 'Kamikaze' Hughes) wrote:

>> And in neither C++ nor Java can you express "c is a container", either
>> directly or indirectly, except in comments
>  That is incorrect for Java, and for most C++ class libraries.
>    List c = new ArrayList();
>    c.add("foo");
>    c.add("bar");
>    System.out.println( c instanceof Collection );
>    System.out.println( c.size() );
>    for(Iterator it = c.iterator(); it.hasNext(); ) {
>        System.out.println( );
>    }

As some googling seems to indicate this is an extendable list of
references. Since int doesn't derive from object, this will probably


One decaffeinated Java with extra coffein please :-)



z,w=zip(range(99,0,-1)+['no'],'s'*98+' s')," on the wall"
n,t="%s bottle%s of beer","take one down, pass it around"
for x,y in zip(z,z[1:]):print'\n'.join((n%x+w,n%x,t,n%y+w,''))

More information about the Python-list mailing list