[Python-Dev] unscriptable?

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Apr 20 01:04:56 CEST 2008


Nick Coghlan wrote:
> Being indexable is subtly different from being subscriptable - the 
> former has stronger connotations of numeric indices and sequence-like 
> behaviour (particularly since the introduction of operator.index), while 
> the latter merely states that the container provides some kinds of 
> mapping from subscripts to values in the container, without provide any 
> implications as to the nature of that mapping.

I don't think everyone would agree with that. For example,
databases have these things that are called "indexes" even
when the value being used as a key isn't a number.
I've never really liked the term "subscript" in this
context, because to me it implies a typographical feature,
i.e. writing something below the baseline, which isn't
normally done in a textual programming language. The
term "index", on the other hand, directly suggests the
idea of looking something up, without relying on
indirection through typography and mathematical convention.
-- 
Greg


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /