Hi,
By the way, a sorted **kwargs may slow down the speed of function invocation.
But we do not know how often the function gets called.
So we mustn't enforce the dict to be sorted for it unpredictable defects in
performance. I need to emphasize the UNPREDICTABLE.
Hongbao Chen
Software Engineering School
Xi'an Jiaotong University
Cell:+8613891979195
________________________________
发件人: "python-ideas-request@python.org"
收件人: python-ideas@python.org
发送日期: 2011/1/21 (周五) 9:59:06 上午
主 题: Python-ideas Digest, Vol 50, Issue 36
Send Python-ideas mailing list submissions to
python-ideas@python.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-ideas
or, via email, send a message with subject or body 'help' to
python-ideas-request@python.org
You can reach the person managing the list at
python-ideas-owner@python.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-ideas digest..."
Today's Topics:
1. Re: A sorted version of **kwargs (Don Spaulding)
2. Re: A sorted version of **kwargs (MRAB)
3. Re: A sorted version of **kwargs (Alexander Belopolsky)
4. Re: A sorted version of **kwargs (Nick Coghlan)
5. Re: A sorted version of **kwargs (Hongbao Chen)
----------------------------------------------------------------------
Message: 1
Date: Thu, 20 Jan 2011 14:26:23 -0600
From: Don Spaulding
To: Bruce Leban
Cc: python-ideas@python.org
Subject: Re: [Python-ideas] A sorted version of **kwargs
Message-ID:
Content-Type: text/plain; charset="iso-8859-1"
On Thu, Jan 20, 2011 at 2:05 PM, Bruce Leban wrote:
On Thu, Jan 20, 2011 at 11:47 AM, Tim Delaney
wrote:
['b':1] would then be ambiguous (appears to be a slice of a list). More
obvious in the case of [1:2] ...
We use parenthesis for tuples and avoid the ambiguity by writing (1,).
In the same way, we could require your examples to be written ['b':1,] and
[1:2,]
Please, not this. I like the idea of syntactic support for the odict, but
no need to spread the (foo,) syntax around. It's too easy to misinterpret
when you do a quick scan of a body of code.