[Python-ideas] Python Users Aren't Perfect
timothy.c.delaney at gmail.com
Thu Dec 15 21:59:26 CET 2011
On 16 December 2011 07:42, Ned Batchelder <ned at nedbatchelder.com> wrote:
> This is another place where Python is inconsistent. We're told, "lists
> are for homogenous sequences of varying length, like a C array; tuples are
> for heterogenous aggregations of known length, like a C struct." Then we
> define a function foo(*args), and Python gives us a tuple! :-(
How is that inconsistent? At the point where the tuple is constructed, it
has a known length. And it's definitely a heterogenous aggregation.
I think where you're getting confused is that you're thinking of a *single*
struct definition for every tuple. But the concept you should have is that
each tuple has its own struct definition. And with functions, the structure
is defined at function call time.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas