Pythonification of the asterisk-based collection packing/unpacking syntax

Evan Driscoll edriscoll at wisc.edu
Sun Dec 18 15:20:20 EST 2011


On 12/18/2011 8:35, Eelco wrote:
> No, its not type *checking*, its type *declaration*. I tried to go to
> great lengths to point that out, but it appears I did not do a very
> good job :). Type declaration is exactly what I want, and insofar this
> syntax has already found adoptation elsewhere, ill consider that a
> plus.
You say it's found adoption elsewhere, but I think it's that adoption
which makes it a *bad* idea, because it does something entirely
different in those situations. Other languages are using that syntax for
something which is statically checked -- you are proposing that syntax
for a dynamic conversion.

look pretty familiar... (Not to mention if you just omit the type from
the examples above you need another way to distinguish between args and
kwargs.)


> Yes, one could opt for a syntax where the collection type is optional
> and a sensible default is chosen, But to me that would largely defeat
> the point; I very much like the added verbosity and explicitness. args-
> tuple and kwargs-dict; that just has a much better ring to it than
> star-star-kwargs, or whatever other cryptic symbol you use.
My problem with it is that it in some sense is forcing me to make a
decision I don't care about. Yes, what we have now is less flexible, but
I have *never* said "man, I wish this *args parameter were a list
instead of a tuple". So at least for me, making me say "args::tuple" or
"@tuple args" or whatever is just changing the syntax a bit and adding
several more characters for me to type.

Evan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 552 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20111218/9e549058/attachment-0001.sig>


More information about the Python-list mailing list