source code size metric: Python and modern C++

Lulu of the Lotus-Eaters mertz at gnosis.cx
Thu Dec 5 13:58:43 EST 2002


Duncan Grisby <duncan-news at grisby.org> wrote previously:
|the Python documentation _does_ explicitly mention argument types.

The examples chosen actually generally contradict the assertion.

|join(seq)
|    Return a string which is the concatenation of the strings in the
|    sequence seq.
     ^^^^^^^^^^^^
|utime(path, times)
|    Set the access and modified times of the file specified by path.
|    If times is None, then the file's access and modified times are
|    set to the current time. Otherwise, times must be a 2-tuple of
|    numbers
     ^^^^^^^
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."  In fact, custom sequences (or custom numbers) word fine
too.

Mind you, I don't think the Python documentation *should* specify type
explicitly.  The "quacks like a duck" philosophy is one of the powerful
features of Python.

Yours, Lulu...

--
 mertz@   _/_/_/_/_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY:_/_/_/_/ v i
gnosis  _/_/                    Postmodern Enterprises         _/_/  s r
.cx    _/_/  MAKERS OF CHAOS....                              _/_/   i u
      _/_/_/_/_/ LOOK FOR IT IN A NEIGHBORHOOD NEAR YOU_/_/_/_/_/    g s





More information about the Python-list mailing list