tuple.index()

Nick Maclaren nmm1 at cus.cam.ac.uk
Fri Dec 15 15:12:30 EST 2006


In article <1166187479.167471.169270 at n67g2000cwd.googlegroups.com>,
"Tim Golden" <tjgolden at gmail.com> writes:
|> [Christoph Zwerschke]
|> 
|> > And can somebody explain what is exactly meant with
|> > "homogenous data"?
|> 
|> This seems to have been explained a few times
|> recently :) Basically, if you have a "list of xs"
|> and remove one item from it, it is still a "list of xs",
|> where "xs" might be people, coordinate-pairs, numbers
|> or whatever made sense to you. If you have a tuple
|> containing, say, a 2d coordinate pair, and remove something
|> from it, it's no longer a coordinate pair. If you add one to it,
|> it's something else as well (perhaps a 3d coord?)

Hmm.  If I remove an object from a list of objects, does it not
remain a list of objects?

The converse is worse, as in my example.  If a heterogeneous list
just happens to have objects that are all similar, does it remain
heterogeneous?

Loose guidelines are very useful, but should almost always come with
the rider "Follow these unless you have good reasons to ignore them,
but do make sure that you understand the rules first before deciding
your rules are good".  Some of the responses here went a little, er,
a lot beyond that.


Regards,
Nick Maclaren.



More information about the Python-list mailing list