f---ing typechecking

Donn Cave donn at u.washington.edu
Thu Feb 15 18:16:01 EST 2007


In article <7xr6srgm3c.fsf at ruckus.brouhaha.com>,
 Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> skip at pobox.com writes:
> > My original comment was that tuples could be thought of more like
> > C structs or Pascal records.
> 
> Should f(*args) receive a list rather than a tuple arg?

No, clearly not.  Function parameters are good example
of exactly what tuples are about, with some extra struct/dict
stuff for emphasis.

If t is a valid argument tuple for function f, then can t[1:]
also be a valia argument tuple for function f?

For ordinary functions without special argument handling, no.
We know that without having to know anything about t, and not
much about f.  This is characteristic of tuple applications.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list