Tuple question

Roy Smith roy at panix.com
Thu Sep 2 13:20:11 EDT 2004


In article <mailman.2775.1094145196.5135.python-list at python.org>,
 Gandalf <gandalf at geochemsource.com> wrote:

> > users = ['admin', 'user1', 'user2']
> > address = ('www.python.org', 80)
> >
> > index and count only make sense when the collection is homogeneous.  
> > Therefore they are not defined for tuple. 
> 
> Why?
> 
> address = ['www.python.org',80]
> 
> A list can hold any kind of objects. I think that the 'index' method for 
> tuples would be a good idea.

Personally, I think it should be more general.  I think index should be 
a sequence method, and tuple should just inherit from that.



More information about the Python-list mailing list