Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16985 > unrolled thread

Verbose and flexible args and kwargs syntax

Started byEelco Hoogendoorn <hoogendoorn.eelco@gmail.com>
First post2011-12-11 15:44 +0100
Last post2011-12-11 15:44 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Verbose and flexible args and kwargs syntax Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com> - 2011-12-11 15:44 +0100

#16985 — Verbose and flexible args and kwargs syntax

FromEelco Hoogendoorn <hoogendoorn.eelco@gmail.com>
Date2011-12-11 15:44 +0100
SubjectVerbose and flexible args and kwargs syntax
Message-ID<mailman.3513.1323614680.27778.python-list@python.org>
>  Yes, that's just a strict keywordification of the * and ** symbols.
>  The same argument could be made for eliminating the standard algebraic
>  + operator and replacing it with a keyword "__add__". I don't think
>  that's worthwhile.


Well, its not quite the same in the sense that algebraic operators are 
essentially part of 'natural language', or at least extremely widely 
adopted. They have earned their own special symbols. Argument 
packing/unpacking is a very specific thing; a small corner of a 
particular programming language.

However, as seen in the light of python 3 head-tail syntax, perhaps the 
above is not quite true, and one could argue that packing/unpacking of 
collections is indeed a quite general concept, deserving of its own 
symbols. Breaking uniformity with that use case would also be a bad 
thing; ideally, a verbose alternative to all occurances of collection 
packing/unpacking would be available.

That said, a more verbose and flexible syntax would be desirable there 
too; as of now, the tail is always a list. I havnt read the discussions 
leading up to those design decisions, but that seems like a compromise 
to me; something like head,tuple(tail) = someiterable would be 
preferrable there too, id say

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web