terminological obscurity

John Roth newsgroups at jhrothjr.com
Fri May 21 21:19:10 EDT 2004


"Grant Edwards" <grante at visi.com> wrote in message
news:slrncastid.5mc.grante at grante.rivatek.com...
> On 2004-05-21, Donn Cave <donn at u.washington.edu> wrote:
>
> >> For example, why shouldn't index() find an object in a
> >> non-homogeneous sequence? Either the object is in the sequence or
> >> it's not. If it is, there is an index that corresponds to it.
> >
> > For example,
> >   tm = time.localtime(time.time())
> >   i = tm.index(5)
> >
> > What would that mean?
> >
> > It's absurd to search for the location of a value in a tuple,
> > because the values don't have any meaning independent of their
> > location.
>
> OK, I see what you mean.  That brings up the question of why
> use integer indexes to access members of of a group of objects
> when the order of the objects is meaningless?

As Ahaz said, because it's lightweight. That's got its benefits
and its drawbacks. In one sense a tuple is a lightweight version
of a Data Object, but it doesn't segue into one cleanly. See the
gyrations that they had to go through to slide a data object in
under the time and stat tuples in release 2.2 (which is something
I heartily approve of - now we need to add a few methods to
those objects...)

John Roth
>
> -- 
> Grant Edwards                   grante             Yow!  Do you guys know
we
>                                   at               just passed thru a
BLACK
>                                visi.com            HOLE in space?





More information about the Python-list mailing list