"Kent Johnson" <ken...@tds.net> wrote

To actually *constrain* a collection to be homogeneous seems extremely un-pythonic. In actual fact all containers can hold whatever you want
to put in them without restriction (except hashability requirements
for sets and dict keys).

And strings which are kind of a collection but only hold characters...

Personally I like to think of Python collections as being like Smalltalk
or ObjectiveC collections. They hold objects. And since everything is
a subclass of object they hold anything... It doesn't work completely
but it mostly keeps me sane... :-)

But it does mean that anything more fine grained than object is
down to the programmer.

Alan G.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to