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


Groups > comp.lang.python > #16985

Verbose and flexible args and kwargs syntax

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-transit.tcx.org.uk!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <hoogendoorn.eelco@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.034
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'operator': 0.04; 'python': 0.08; 'essentially': 0.10; 'discussions': 0.12; 'argument': 0.15; 'decisions,': 0.16; 'eliminating': 0.16; 'ideally,': 0.16; 'preferrable': 0.16; 'received:192.168.0.11': 0.16; 'subject:syntax': 0.16; 'syntax': 0.16; 'seems': 0.20; 'programming': 0.21; 'replacing': 0.23; 'keyword': 0.24; 'language.': 0.28; 'true,': 0.29; 'argue': 0.30; 'collections': 0.30; 'compromise': 0.30; 'received:mail-bw0-f46.google.com': 0.30; 'syntax,': 0.30; 'tail': 0.30; 'least': 0.30; 'quite': 0.32; 'received:209.85.214': 0.32; 'message-id:@gmail.com': 0.33; 'header:User-Agent:1': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'light': 0.35; 'list.': 0.35; 'something': 0.35; 'however,': 0.36; 'desirable': 0.37; 'but': 0.37; 'corner': 0.37; 'received:192': 0.37; 'received:google.com': 0.37; 'think': 0.37; 'could': 0.37; 'too,': 0.38; 'received:192.168.0': 0.38; 'received:209.85': 0.38; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'received:192.168': 0.40; 'extremely': 0.40; 'more': 0.61; 'design': 0.61; 'leading': 0.62; 'alternative': 0.65; 'special': 0.68; 'collection': 0.69; 'concept,': 0.84; 'me;': 0.84; 'worthwhile.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=KrdjJxDUMVLBW29o9hWR8ZXCoGtBQNBP0R46UeZps68=; b=mTWaQaQ5B6cbMbgP+5FYDlUMZPC5dHrxTyV/M865ApOef/4vI50kwdnwcsd8a9Tqb3 boaUjlt7v+sNu47KAx2XZlic2d4lpAxyT7R0LxSvaq6TughcH0A9xoEWACog3DIqYuXd duBcrf0b60rHUqNA6ziBlL+L2/rltKg7rbkQc=
Date Sun, 11 Dec 2011 15:44:37 +0100
From Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version 1.0
To python-list@python.org
Subject Verbose and flexible args and kwargs syntax
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3513.1323614680.27778.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1323614680 news.xs4all.nl 6918 [2001:888:2000:d::a6]:40026
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:16985

Show key headers only | View raw


>  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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web