source code size metric: Python and modern C++

Lulu of the Lotus-Eaters mertz at gnosis.cx
Fri Dec 6 00:24:04 EST 2002


Lulu of the Lotus-Eaters <mertz at gnosis.cx> writes:
> Neither 'sequence' nor 'number' are Python types.
> List are types, as are tuples, as are ints, longs, floats.  But
> 'sequence' and 'number' are more like schematic references to "some
> type that behaves enough like we need it to."

Avery Andrews <andrews at pcug.org.au> wrote previously:
|Maybe they could be called `proto-types'
| a) they express the essential intuition behind a real formally
|     defined type
| b) they are literally what linguistics/cognitive sci people would
|     call 'prototypes', lists of properties that a typical member of
|     a category would have, without being necessary or sufficient
|     criteria for belonging to that category

Actually, this isn't quite right as to what a prototype is in cognitive
linguistics.  There's a distinction between a predicative category and a
prototype-based category.  Elenor Rosch is a particularly important
figure here; but I get more of my knowledge of it from George Lakoff and
Mark Johnson.

The schtick here is that classical thinkers thought a category consisted
of a set of properties that all members of the category must have.
Birds are warm-blooded, egg-laying animals with feathers.  Anything with
all these traits is a bird, anything lacking one or more of them isn't.

It turns out that human cognition isn't really structured in this
propositional way.  Instead, categories are -recognized- by a few central
members that are the "best examples" of the category.  All the other
things that are members are identified by virtue of a chain of
connections with the central members.  A robin is a very bird-like bird,
a penguin, or ostrich, or turkey, less so.  But the penguin and ostrich
are recognized as birds via -spokes- connecting them to robins
(different spokes for the two, but maybe an emu is at the end of the
same spoke as an ostrich).

This isn't to say that the necessary-and-sufficient conditions
previously listed for birdness are -wrong-.  In the abstract, those
really are the right predicates (unless they're not, I'm not making a
zoological claim here, but a philosophical one).  But in the concrete of
human cognition, judgement has a different structure.  Not such a
propositional one.

In terms of Python, it would be more within this way of talking to say
that "lists are prototypical sequences."  The concrete thing is the
"best case example" of what a sequence is.  But a tuple is a lot like a
list, just not mutable.  And a file iterator is also like a list, only
access is sequential rather than by index.  And a UserList is quite a
bit like a list, but it has to be initialized with a class rather than
with a inherent syntax.  And so on.  There is a category of sequences
which we concretely recognize by a series of family resemblances to the
prototypical -list-.

Yours, Lulu...


--
 mertz@  _/_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: \_\_\_\_    n o
gnosis  _/_/             Postmodern Enterprises            \_\_
.cx    _/_/                                                 \_\_  d o
      _/_/_/ IN A WORLD W/O WALLS, THERE WOULD BE NO GATES \_\_\_ z e





More information about the Python-list mailing list