On Sep 10, 2013, at 4:28 AM, Antoine Pitrou wrote:
> In http://bugs.python.org/issue18986 I proposed adding a new mapping
> type to the collections module.
I would *really* like for this to start outside the standard library.
It needs to mature with user feedback before being dumped
in the coll
On 10 September 2013 18:46, Antoine Pitrou wrote:
> On Tue, 10 Sep 2013 18:44:20 -0300
> "Joao S. O. Bueno" wrote:
>> On 10 September 2013 18:06, Antoine Pitrou wrote:
>> > On Tue, 10 Sep 2013 17:38:26 -0300
>> > "Joao S. O. Bueno" wrote:
>> >> On 10 September 2013 16:08, Paul Moore wrote:
>>
On 09/10/2013 05:26 PM, Eric V. Smith wrote:
On 9/10/2013 6:18 PM, Ethan Furman wrote:
On 09/10/2013 03:12 PM, MRAB wrote:
On 10/09/2013 22:46, Antoine Pitrou wrote:
On Tue, 10 Sep 2013 18:44:20 -0300
"Joao S. O. Bueno" wrote:
On 10 September 2013 18:06, Antoine Pitrou wrote:
On Tue, 10 Se
On 9/10/2013 2:46 PM, Antoine Pitrou wrote:
> >>Which reminds one - this class should obviously have a method for
> >>retrivieng the original key value, given a matching key -
> >>
> >>d.canonical('foo') -> 'Foo'
> >
> >I don't know. Is there any use case?
> >(sure, it is trivially implemented)
On 9/10/2013 6:18 PM, Ethan Furman wrote:
> On 09/10/2013 03:12 PM, MRAB wrote:
>> On 10/09/2013 22:46, Antoine Pitrou wrote:
>>> On Tue, 10 Sep 2013 18:44:20 -0300
>>> "Joao S. O. Bueno" wrote:
On 10 September 2013 18:06, Antoine Pitrou wrote:
> On Tue, 10 Sep 2013 17:38:26 -0300
On 09/10/2013 03:12 PM, MRAB wrote:
On 10/09/2013 22:46, Antoine Pitrou wrote:
On Tue, 10 Sep 2013 18:44:20 -0300
"Joao S. O. Bueno" wrote:
On 10 September 2013 18:06, Antoine Pitrou wrote:
> On Tue, 10 Sep 2013 17:38:26 -0300
> "Joao S. O. Bueno" wrote:
>> On 10 September 2013 16:08, Paul M
On Tue, 10 Sep 2013 18:44:20 -0300
"Joao S. O. Bueno" wrote:
> On 10 September 2013 18:06, Antoine Pitrou wrote:
> > On Tue, 10 Sep 2013 17:38:26 -0300
> > "Joao S. O. Bueno" wrote:
> >> On 10 September 2013 16:08, Paul Moore wrote:
> >> > If you provide "retain the last", I can't see any obvio
On 09/10/2013 01:36 PM, Lukas Lueg wrote:
Should'nt the key'ing behaviour be controlled by the type of the key instead of
the type of the container?
That would be up to the key function.
--
~Ethan~
___
Python-Dev mailing list
Python-Dev@python.org
On 10 September 2013 18:06, Antoine Pitrou wrote:
> On Tue, 10 Sep 2013 17:38:26 -0300
> "Joao S. O. Bueno" wrote:
>> On 10 September 2013 16:08, Paul Moore wrote:
>> > If you provide "retain the last", I can't see any obvious way of
>> > implementing "retain the first" in application code witho
On 10/09/2013 22:46, Antoine Pitrou wrote:
On Tue, 10 Sep 2013 18:44:20 -0300
"Joao S. O. Bueno" wrote:
On 10 September 2013 18:06, Antoine Pitrou wrote:
> On Tue, 10 Sep 2013 17:38:26 -0300
> "Joao S. O. Bueno" wrote:
>> On 10 September 2013 16:08, Paul Moore wrote:
>> > If you provide "ret
Should'nt the key'ing behaviour be controlled by the type of the key
instead of the type of the container?
2013/9/10 MRAB
> On 10/09/2013 20:08, Paul Moore wrote:
>
>> On 10 September 2013 19:31, Antoine Pitrou wrote:
>>
>>> I think it would be a flaw to have this detail implementation-defined
On 10 September 2013 20:59, MRAB wrote:
>> try:
>> del d[k]
>> finally:
>> d[k] = v
>>
> That would raise a KeyError is the key was missing. A better way is:
>
> d.pop(k, None)
Sorry, I was thinking of try...except: pass. But pop is indeed better.
Teach me to code stuff on the fly witho
On 10 September 2013 16:08, Paul Moore wrote:
> If you provide "retain the last", I can't see any obvious way of
> implementing "retain the first" in application code without in effect
> reimplementing the class.
Which reminds one - this class should obviously have a method for
retrivieng the ori
On Tue, 10 Sep 2013 17:38:26 -0300
"Joao S. O. Bueno" wrote:
> On 10 September 2013 16:08, Paul Moore wrote:
> > If you provide "retain the last", I can't see any obvious way of
> > implementing "retain the first" in application code without in effect
> > reimplementing the class.
>
> Which remi
On 10/09/2013 20:08, Paul Moore wrote:
On 10 September 2013 19:31, Antoine Pitrou wrote:
I think it would be a flaw to have this detail implementation-defined.
This would be like saying that it is implementation-defined which
of A,B,C is returned from "A and B and C" if all are true.
Ok, it s
On 10 September 2013 19:31, Antoine Pitrou wrote:
>> I think it would be a flaw to have this detail implementation-defined.
>> This would be like saying that it is implementation-defined which
>> of A,B,C is returned from "A and B and C" if all are true.
>
> Ok, it seems everyone (except me :-)) a
On Tue, 10 Sep 2013 14:44:01 +0200
"Martin v. Löwis" wrote:
> Am 10.09.13 14:35, schrieb Antoine Pitrou:
> >> ['FOO'] or ['foo']? Both answers are justifiable. Both are possibly
> >> even useful depending on context...
> >
> > I think it would be best to leave it as an implementation detail,
> >
On Tue, 10 Sep 2013 16:21:18 +0100, Nigel Small wrote:
> Could a more generic variant of this class work? In the same way that
> `sorted` can accept a comparison function, similar could be done for a
> dictionary-like class:
>
> d = transformdict(key=str.lower)
>
> Strictly speaking, this would
On 10/09/2013 11:58am, 张佩佩 wrote:
Hello:
I wondering why there is no standard IOCP module in Python ?
As I know: Python3 have support epoll in linux and kqueue in freebsd.
Is there a plan to add IOCP module for Windows ?
_winapi does have some undocumented support for IOCP (used only by
On 09/10/2013 07:54 AM, Antoine Pitrou wrote:
Le Tue, 10 Sep 2013 15:09:56 +0200,
Hrvoje Niksic a écrit :
On 09/10/2013 02:24 PM, Paul Moore wrote:
td['FOO'] = 42
td['foo'] = 32
list(td.keys())
['FOO'] or ['foo']? Both answers are justifiable.
Note that the same question can be reasonably
On 9/10/2013 8:08 AM, Guido van Rossum wrote:
Why do several posts in this thread have an Unsubscribe link that
tries to unsubscribe me from the list? (I saw one by Glen, and another
one by Donald Stufft.)
Seems to be in all of them. Probably added by the mailing list software.
Why don't you
On Sep 10, 2013, at 08:08 AM, Guido van Rossum wrote:
>Why do several posts in this thread have an Unsubscribe link that tries to
>unsubscribe me from the list? (I saw one by Glen, and another one by Donald
>Stufft.)
This is way off topic, but I suspect your original response didn't trim your
lit
Could a more generic variant of this class work? In the same way that
`sorted` can accept a comparison function, similar could be done for a
dictionary-like class:
d = transformdict(key=str.lower)
Strictly speaking, this would provide case-insensitive but not
case-preserving behaviour. For any gi
On 9/10/2013 8:54 AM, Janzert wrote:
I intuitively expected, and I think most often would want, the first
key to be held.
My intuition matches yours, but my thoughts are that it should be
changeable by specific request.
___
Python-Dev mailing list
On 09/10/2013 11:54 AM, Janzert wrote:
> On 9/10/2013 10:54 AM, Antoine Pitrou wrote:
>> (also, I would intuitively expect the latest key to be held, not the
>> first one, since that's what happens for values.)
>>
>> Regards
>>
>> Antoine.
>>
>
> I intuitively expected, and I think most often woul
MS Windows is on a steep decline? I mean, I know Windows 8 isn't the most
popular thing on the planet, but...Windows itself? If anything would be
rising, I'd still prefer it to be either Linux or Haiku.
On Tue, Sep 10, 2013 at 12:48 AM, Stefan Behnel wrote:
> Ned Deily, 09.09.2013 21:29:
> > 3.
On 9/10/2013 10:54 AM, Antoine Pitrou wrote:
(also, I would intuitively expect the latest key to be held, not the
first one, since that's what happens for values.)
Regards
Antoine.
I intuitively expected, and I think most often would want, the first key
to be held. The reason being that I w
On Tue, Sep 10, 2013 at 11:28:25AM -0400, Donald Stufft
wrote:
> On Sep 10, 2013, at 11:08 AM, Guido van Rossum wrote:
> > Why do several posts in this thread have an Unsubscribe link that tries to
> > unsubscribe me from the list? (I saw one by Glen, and another one by Donald
> > Stufft.)
> >
On Sep 10, 2013, at 11:08 AM, Guido van Rossum wrote:
> Why do several posts in this thread have an Unsubscribe link that tries to
> unsubscribe me from the list? (I saw one by Glen, and another one by Donald
> Stufft.)
>
> (Come to think of it, what's the point of having an Unbub link in eve
On 09/10/2013 06:09 AM, Hrvoje Niksic wrote:
On 09/10/2013 02:24 PM, Paul Moore wrote:
td['FOO'] = 42
td['foo'] = 32
list(td.keys())
['FOO'] or ['foo']? Both answers are justifiable.
Note that the same question can be reasonably asked for dict itself:
d = {}
d[1.0] = 'foo'
d[1] = 'bar'
d
Why do several posts in this thread have an Unsubscribe link that tries to
unsubscribe me from the list? (I saw one by Glen, and another one by Donald
Stufft.)
(Come to think of it, what's the point of having an Unbub link in ever
message that goes out?)
On Tue, Sep 10, 2013 at 12:21 AM, Glenn L
On 10/09/2013 3:15pm, Armin Rigo wrote:
Hi Richard,
On Tue, Sep 10, 2013 at 3:42 PM, Richard Oudkerk wrote:
I guess another example is creating an "identity dict" (see
http://code.activestate.com/lists/python-ideas/7161/) by doing
d = transformdict(id)
This is bogus, because only the i
Le Tue, 10 Sep 2013 16:15:56 +0200,
Armin Rigo a écrit :
> Hi Richard,
>
> On Tue, Sep 10, 2013 at 3:42 PM, Richard Oudkerk
> wrote:
> > I guess another example is creating an "identity dict" (see
> > http://code.activestate.com/lists/python-ideas/7161/) by doing
> >
> > d = transformdict(id
One will come with Tulip (http://code.google.com/p/tulip/), assuming we can
get PEP 3156 accepted at least as "experimental" and the core Tulip code in
the stdlib. At the moment the IOCP code there is pretty specialized for use
with Tulip -- but if you want to help extracting the IOCP code from the
Le Tue, 10 Sep 2013 15:09:56 +0200,
Hrvoje Niksic a écrit :
> On 09/10/2013 02:24 PM, Paul Moore wrote:
> td['FOO'] = 42
> td['foo'] = 32
> list(td.keys())
> >
> > ['FOO'] or ['foo']? Both answers are justifiable.
>
> Note that the same question can be reasonably asked for dict its
Hello:
I wondering why there is no standard IOCP module in Python ?
As I know: Python3 have support epoll in linux and kqueue in freebsd.
Is there a plan to add IOCP module for Windows ?
Regards!
peipei
___
Python-Dev mailing list
Python-Dev@pyth
On Tue, Sep 10, 2013 at 11:28 AM, Antoine Pitrou wrote:
> Therefore I propose adding the general pattern. Simple example:
>
>>>> d = transformdict(str.lower)
>>>> d['Foo'] = 5
>>>> d['foo']
>5
>>>> d['FOO']
>5
>>>> list(d)
>['Foo']
>
> (case-insensitive but case-pre
Le Tue, 10 Sep 2013 07:18:41 -0700,
Eli Bendersky a écrit :
> On Tue, Sep 10, 2013 at 5:22 AM, Antoine Pitrou
> wrote:
>
> > Le Tue, 10 Sep 2013 22:00:37 +1000,
> > Nick Coghlan a écrit :
> > > Is this just syntactic sugar for recursive lookup of a transformed
> > > version in __missing__?
> >
On Tue, Sep 10, 2013 at 5:22 AM, Antoine Pitrou wrote:
> Le Tue, 10 Sep 2013 22:00:37 +1000,
> Nick Coghlan a écrit :
> > Is this just syntactic sugar for recursive lookup of a transformed
> > version in __missing__?
>
> Nope. For one, it doesn't use __missing__ at all. I think
> using __missing
Hi Richard,
On Tue, Sep 10, 2013 at 3:42 PM, Richard Oudkerk wrote:
> I guess another example is creating an "identity dict" (see
> http://code.activestate.com/lists/python-ideas/7161/) by doing
>
> d = transformdict(id)
This is bogus, because only the id will be stored, and the original
key
Hi Mark,
On Mon, Sep 9, 2013 at 11:18 PM, Mark Shannon wrote:
> 5. Other implementations. What do the Jython/IronPython/PyPy developers
> think?
Thanks for asking :-) I'm fine with staying out of language design
issues like this one, and I believe it's the general concensus in
PyPy. Whatever g
On Sep 10, 2013, at 03:57 PM, Antoine Pitrou wrote:
>Le Tue, 10 Sep 2013 09:49:28 -0400,
>Barry Warsaw a écrit :
>> On Sep 10, 2013, at 12:04 PM, Victor Stinner wrote:
>>
>> >The http.client and email.message modules convert headers to lower
>> >case, but keep the original case.
>>
>> As RDM po
Le Tue, 10 Sep 2013 09:49:28 -0400,
Barry Warsaw a écrit :
> On Sep 10, 2013, at 12:04 PM, Victor Stinner wrote:
>
> >The http.client and email.message modules convert headers to lower
> >case, but keep the original case.
>
> As RDM pointed out on the tracker, email headers aren't a great use
>
On Sep 10, 2013, at 12:04 PM, Victor Stinner wrote:
>The http.client and email.message modules convert headers to lower
>case, but keep the original case.
As RDM pointed out on the tracker, email headers aren't a great use case for
this because they aren't really dictionaries. They're lists with
On 10/09/2013 10:28am, Antoine Pitrou wrote:
Therefore I propose adding the general pattern. Simple example:
>>> d = transformdict(str.lower)
>>> d['Foo'] = 5
>>> d['foo']
5
>>> d['FOO']
5
>>> list(d)
['Foo']
I guess another example is creating an "identity dict
On 09/10/2013 02:24 PM, Paul Moore wrote:
td['FOO'] = 42
td['foo'] = 32
list(td.keys())
['FOO'] or ['foo']? Both answers are justifiable.
Note that the same question can be reasonably asked for dict itself:
>>> d = {}
>>> d[1.0] = 'foo'
>>> d[1] = 'bar'
>>> d
{1.0: 'bar'}
So, dict.__setitem
Am 10.09.13 14:35, schrieb Antoine Pitrou:
>> ['FOO'] or ['foo']? Both answers are justifiable. Both are possibly
>> even useful depending on context...
>
> I think it would be best to leave it as an implementation detail,
> because whichever is easiest to implement depends on the exact
> implemen
Le Tue, 10 Sep 2013 13:24:29 +0100,
Paul Moore a écrit :
> On 10 September 2013 13:00, Nick Coghlan wrote:
> > Is this just syntactic sugar for recursive lookup of a transformed
> > version in __missing__? Or a way of supplying a custom "key"
> > function to a dictionary?
>
> Not quite, because
On 10 September 2013 13:00, Nick Coghlan wrote:
> Is this just syntactic sugar for recursive lookup of a transformed version
> in __missing__? Or a way of supplying a custom "key" function to a
> dictionary?
Not quite, because the dict should preserve the originally entered key.
>>> td['FOO'] =
On 10 September 2013 13:24, Paul Moore wrote:
> On 10 September 2013 13:00, Nick Coghlan wrote:
>> Is this just syntactic sugar for recursive lookup of a transformed version
>> in __missing__? Or a way of supplying a custom "key" function to a
>> dictionary?
>
> Not quite, because the dict should
Le Tue, 10 Sep 2013 22:00:37 +1000,
Nick Coghlan a écrit :
> Is this just syntactic sugar for recursive lookup of a transformed
> version in __missing__?
Nope. For one, it doesn't use __missing__ at all. I think
using __missing__ would be... missing the point, because it wouldn't
working properly
Is this just syntactic sugar for recursive lookup of a transformed version
in __missing__? Or a way of supplying a custom "key" function to a
dictionary?
Any such proposal should consider how it composes with other dict variants
like defaultdict, OrderedDict and counter.
Cheers,
Nick.
___
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Am 05.09.13 19:31, schrieb Jesus Cea:
> What are you using?. bugs.python.org admins could share some data?
Most users use one of the large services:
https://www.google.com 3326
https://login.launchpad.net 335
https://*.myopenid.com 253
https://launch
On Tue, Sep 10, 2013 at 11:28 AM, Antoine Pitrou wrote:
> On the tracker issue, it seems everyone agreed on the principle. There
> is some bikeshedding left to do, though. So here are the reasonable
> naming proposals so far:
>
> - transformkeydict
> - coercekeydict
> - transformdict
> - coercedic
On 10 September 2013 10:28, Antoine Pitrou wrote:
> On the tracker issue, it seems everyone agreed on the principle. There
> is some bikeshedding left to do, though. So here are the reasonable
> naming proposals so far:
>
> - transformkeydict
> - coercekeydict
> - transformdict
> - coercedict
>
>
2013/9/10 Antoine Pitrou :
> In http://bugs.python.org/issue18986 I proposed adding a new mapping
> type to the collections module.
>
> The original use case is quite common in network programming and
> elsewhere (Eric Snow on the tracker mentioned an application with stock
> symbols). You want to
Le Tue, 10 Sep 2013 04:42:46 -0500,
Skip Montanaro a écrit :
> > (case-insensitive but case-preserving, as the best filesystems
> > are ;-))
>
> > I have a sweet spot for "transformdict" myself.
>
> Antoine,
>
> "Transform" does not remind me of "case-insensitive but
> case-preserving".
That w
> (case-insensitive but case-preserving, as the best filesystems are ;-))
> I have a sweet spot for "transformdict" myself.
Antoine,
"Transform" does not remind me of "case-insensitive but
case-preserving". If this is important enough to put into the
collections module (I'm skeptical), shouldn't
Hello,
In http://bugs.python.org/issue18986 I proposed adding a new mapping
type to the collections module.
The original use case is quite common in network programming and
elsewhere (Eric Snow on the tracker mentioned an application with stock
symbols). You want to have an associative container
Ok, can this discussion go off python-dev, please? This has been
terribly off-topic for a long time (arguably from the beginning,
actually).
Thank you
Antoine.
Le Tue, 10 Sep 2013 00:21:28 -0700,
Glenn Linderman a écrit :
> On 9/6/2013 10:22 AM, Dan Callahan wrote:
> > On 9/5/13 12:31 PM, Je
On 9/6/2013 10:22 AM, Dan Callahan wrote:
On 9/5/13 12:31 PM, Jesus Cea wrote:
I have big hopes for Mozilla Persona, looking forward
Python infrastructure support :).
Hi, I'm the project lead on Persona signin, and I spoke at PyCon
earlier this year regarding why and how Mozilla is building P
61 matches
Mail list logo