<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 12/15/2011 3:59 PM, Tim Delaney wrote:
<blockquote
cite="mid:CAN8CLg==syWhJcOHKyyrhaoRKW8UQ7nTB1e6kTuOGo5Psjou3Q@mail.gmail.com"
type="cite">
<div class="gmail_quote">On 16 December 2011 07:42, Ned Batchelder
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:ned@nedbatchelder.com">ned@nedbatchelder.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">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! :-(</div>
</blockquote>
<div><br>
</div>
<div>How is that inconsistent? At the point where the tuple is
constructed, it has a known length. And it's definitely a
heterogenous aggregation.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
</div>
</blockquote>
Tim, this seems misguided to me. Finish that foo function
definition: it will *have* to have "for a in args:" Since I don't
know the length of args when I write the function, I have to treat
it as an unknown length. What good is a "structure" that changes
length and definition with every instance? I think you're trying
too hard to fit the reality into the theory.<br>
<br>
--Ned.<br>
<br>
<blockquote
cite="mid:CAN8CLg==syWhJcOHKyyrhaoRKW8UQ7nTB1e6kTuOGo5Psjou3Q@mail.gmail.com"
type="cite">
<div class="gmail_quote">
<div>Tim Delaney </div>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-ideas">http://mail.python.org/mailman/listinfo/python-ideas</a>
</pre>
</blockquote>
</body>
</html>