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


Groups > comp.lang.python > #17025

Verbose and flexible args and kwargs syntax

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-3.ams.xsnews.nl!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.077
X-Spam-Evidence '*H*': 0.85; '*S*': 0.00; 'python': 0.08; 'general.': 0.16; 'is;': 0.16; 'mutated': 0.16; 'received:192.168.0.11': 0.16; 'subject:syntax': 0.16; 'unpacking': 0.16; 'examples': 0.16; 'language': 0.17; 'not.': 0.28; 'repeatedly': 0.28; 'received :mail-bw0-f46.google.com': 0.30; 'tail': 0.30; 'quite': 0.32; 'does': 0.32; 'represents': 0.32; 'words,': 0.32; 'received:209.85.214': 0.32; 'message-id:@gmail.com': 0.33; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.34; 'things': 0.34; 'question': 0.36; 'for?': 0.37; 'sequence': 0.37; 'but': 0.37; 'received:192': 0.37; 'received:google.com': 0.37; 'think': 0.37; 'received:192.168.0': 0.38; 'received:209.85': 0.38; 'represent': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'received:192.168': 0.40; 'more': 0.61; 'design': 0.61; 'your': 0.61; 'our': 0.64; 'anything.': 0.71; 'seldom': 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=eEfQYQej+zvTvEHiDll2/F/lBB9jqJT/+YpLHhT22IE=; b=W9zdeNxYSgonTN25YbAZzoRzUB/1+2wGaa7nmEo/nO4Q7CQjjxYmOKilDyk5dnmh3y jY7qKOKgEWfTZYt6ikH6Yxj5mtjg8yILRZidKXFtry3P/i0ZYaqQ/DdNeGRasp5Xo9+x NvbYNxGxiWJG9szt9Dl7wRdjAQ37XOCNPmVqM=
Date Mon, 12 Dec 2011 10:12:22 +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.3536.1323681145.27778.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1323681145 news.xs4all.nl 6933 [2001:888:2000:d::a6]:44789
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:17025

Show key headers only | View raw


>  The above examples are seldom needed in Python because we have one
>  general method to repeatedly split a sequence into head and tail.

>  it = iter(iterable) # 'it' now represents the sequenced iterable
>  head = next(it) # 'it' now represents the tail after removing the head

>  In other words, next(it) encompasses all of your examples and many more.
>  Because 'it' is mutated to represent the tail, it does not need to be
>  rebound and therefore is not.


The question in language design is never 'could we do these things 
before'. The answer is obvious: yes our CPUs are turing complete; we can 
do anything. The question is; how would we like to do them?

So do you think the new head/tail unpacking features in python 3 are 
entirely uncalled for? I personally quite like them, but I would like 
them to be more general.

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-12 10:12 +0100

csiph-web