terminological obscurity

Terry Reedy tjreedy at udel.edu
Fri May 21 15:54:50 EDT 2004


"Elaine Jackson" <elainejackson7355 at home.com> wrote in message
news:L6erc.519686$Pk3.412259 at pd7tw1no...
> Some questions from a curious monkey.
>
> All tuple methods are also list methods, and most list methods are also
tuple
> methods; among those that are NOT also tuple methods, there are exactly
two
> ('count' and 'index') that do not involve mutation. Is there any special
reason
> why they AREN'T also tuple methods?

Is history a special reason?  Once upon a time, (before 2.2) tuples (and
some other types) had no methods.  Those it now has are generic object and
sequence methods.  Guido did not add the two non-mutating list methods
because he does not consider them needed for tuples.  That is related to
his view that tuples are for hetero and not for homo sequences.

Others have made the same observation you did.   Google might reveal more,
or some posts might be on the PyDev archives.

#################################################################
> A question about terminology ('namespace'):
>
> >>> prince=tuple()
> >>> king=[prince]
> >>> del prince
>
> At this point, does the object formerly known as prince belong to the
namespace
> implemented by globals()?

I personally do not think of objects as 'belonging' to a namespace.  They
'exist' in a separate 'dataspace' and get non-exclusively associated with 0
or more names in 0 or more namespaces.

If the above is the complete program up to that point, then the empty tuple
is not directly associated with 'king', the only remaining name, but is
associated with the first slot of king, king[0].  So pick your answer or
reformulate your question.

> More generally, is there a terminological way to
> distinguish between (1) a function from a set of names into a set of
objects,
a namespace
> and (2) the aforementioned set of objects?
a dataspace

#################################################################
> Is there a handy noun that refers to sameness of identity in the same way
that
> 'equality' refers to sameness of value?

identity

> ('Identicalness' is pretty clumsy, and
> 'identity' is confusing, since it already has a meaning that is closely
related
> but needs to be kept distinct.)

English words sometimes have similar but distinct meanings.  In brief, my
dictionary says 'identity': 1. sameness; 2. individuality.

#################################################################
> A question about terminology ('name'):
>
> Suppose X is a container that contains n items (incidentally, is 'items'
the
> right term?)

Yes (which is to say, I use it all the time ;-).

>and i in an integer with 0<=i<=n. Does " X[i] " count as a 'name'?

Only allegorically in that it does identify an item.  In an expression
context, 'X[i]' is an expression.  To the left of '=', it is a 'target':
names are a subset of targets.

'name' is pretty strictly defined as <alpha> <alnum>*.  There are proposals
to expand the set but that is another thread (and controversy).

Terry J. Reedy







More information about the Python-list mailing list