Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-05 Thread Forest
On Wed, Wed, 4 Mar 2009 13:52:59 -0800, Guido van Rossum wrote: > On Wed, Mar 4, 2009 at 1:44 PM, Greg Ewing > wrote: >> rdmur...@bitdance.com wrote: >> >>> I actually like StableDict best. ?When I hear that I think, "ah, the >>> key order is stable in the face of insertions, unlike a regular dict

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Dennis Benzinger
Hi Nick! Am 04.03.2009 22:34, Nick Coghlan schrieb: > Dennis Benzinger wrote: >> I'd prefer encoding the order in the class name, therefore I suggest >> (Ins|Insertion)(Order|Ordered)Dict, e.g. InsOrderDict. Abbreviating the >> first group to simply I probably is too confusing because of the use o

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Lie Ryan
Terry Reedy wrote: Lie Ryan wrote: Isn't ordered dictionary essentially also an "always sorted" container? It is always sorted depending on the order of insertion? I can't see any technical reason why the data structure can't accommodate them both. Can you point me to a discussion on this?

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Lie Ryan
Steven D'Aprano wrote: I also can't think of an alternative explanation, so thus far, it's resistant to false positive semantics. "The keys don't expire with time." "It's stable against accidental deletions." "It's stable against accidentally over-writing values." Add to that: "The StableDict

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Guido van Rossum
On Wed, Mar 4, 2009 at 1:44 PM, Greg Ewing wrote: > rdmur...@bitdance.com wrote: > >> I actually like StableDict best.  When I hear that I think, "ah, the >> key order is stable in the face of insertions, unlike a regular dict". > > But it still doesn't convey what the ordering actually *is*. Ple

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Greg Ewing
rdmur...@bitdance.com wrote: I actually like StableDict best. When I hear that I think, "ah, the key order is stable in the face of insertions, unlike a regular dict". But it still doesn't convey what the ordering actually *is*. -- Greg ___ Python-

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Nick Coghlan
Dennis Benzinger wrote: > I'd prefer encoding the order in the class name, therefore I suggest > (Ins|Insertion)(Order|Ordered)Dict, e.g. InsOrderDict. Abbreviating the > first group to simply I probably is too confusing because of the use of > I as a prefix for interfaces. Except I just don't see

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Nick Coghlan
Lie Ryan wrote: > Isn't ordered dictionary essentially also an "always sorted" container? > It is always sorted depending on the order of insertion? I can't see any > technical reason why the data structure can't accommodate them both. Can > you point me to a discussion on this? My phrasing was a

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Dennis Benzinger
Am 04.03.2009 14:25, Benji York schrieb: > On Wed, Mar 4, 2009 at 3:01 AM, Glenn Linderman wrote: > >> C'mon folks, brainstorm, don't complain about ordereddict if you can't come >> up with some alternatives for discussion!!! (and some reasons why the >> suggestions might be good or bad) Even y

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steven D'Aprano
Leif Walsh wrote: On Wed, Mar 4, 2009 at 7:53 AM, wrote: I actually like StableDict best. When I hear that I think, "ah, the key order is stable in the face of insertions, unlike a regular dict". Nor can I at the moment think of an alternative explanation of what a "StableDict" might be. Hm

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Terry Reedy
Lie Ryan wrote: Isn't ordered dictionary essentially also an "always sorted" container? It is always sorted depending on the order of insertion? I can't see any technical reason why the data structure can't accommodate them both. Can you point me to a discussion on this? Appending an item at

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Leif Walsh
On Wed, Mar 4, 2009 at 7:53 AM, wrote: > I actually like StableDict best.  When I hear that I think, "ah, the > key order is stable in the face of insertions, unlike a regular dict". > Nor can I at the moment think of an alternative explanation of what a > "StableDict" might be. Hmm, perhaps a b

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Leif Walsh
On Wed, Mar 4, 2009 at 7:53 AM, wrote: > I actually like StableDict best.  When I hear that I think, "ah, the > key order is stable in the face of insertions, unlike a regular dict". > Nor can I at the moment think of an alternative explanation of what a > "StableDict" might be. +1 -- Cheers,

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Lie Ryan
Nick Coghlan wrote: Lie Ryan wrote: How about making odict ordered by insertion order, then provide an optional argument for defining sorter? This optional argument must be a function/lambda/callable object and must be the first argument. or better yet, in the spirit of dumping cmp comparison

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Antoine Pitrou
bitdance.com> writes: > > I actually like StableDict best. When I hear that I think, "ah, the > key order is stable in the face of insertions, unlike a regular dict". > Nor can I at the moment think of an alternative explanation of what a > "StableDict" might be. > > That said, I have no proble

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Benji York
On Wed, Mar 4, 2009 at 3:01 AM, Glenn Linderman wrote: > C'mon folks, brainstorm, don't complain about ordereddict if you can't come > up with some alternatives for discussion!!!  (and some reasons why the > suggestions might be good or bad)  Even your bad ideas might trigger a good > name in som

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread rdmurray
On Wed, 4 Mar 2009 at 23:37, Lie Ryan wrote: Steve Holden wrote: Raymond Hettinger wrote: > > > Perhaps the terminology should be > > > > > >ordereddict -- what we have here > > > > > >sorteddict -- hypothetical future type that keeps > > > itself sorted in key orde

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Lie Ryan
Steve Holden wrote: Raymond Hettinger wrote: Perhaps the terminology should be ordereddict -- what we have here sorteddict -- hypothetical future type that keeps itself sorted in key order +1 FIFOdict ? Yeah, that blows the capitalization scheme, way, way out. Issues:

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Nick Coghlan
Lie Ryan wrote: How about making odict ordered by insertion order, then provide an > optional argument for defining sorter? This optional argument must be a > function/lambda/callable object and must be the first argument. As the PEP mentions (and Hrvoje brought up again already in this thread),

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steve Holden
Raymond Hettinger wrote: > >>> Perhaps the terminology should be >>> >>> ordereddict -- what we have here >>> >>> sorteddict -- hypothetical future type that keeps >>> itself sorted in key order > > +1 > > >> FIFOdict ? Yeah, that blows the capitalization scheme, way, way o

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Lie Ryan
Gisle Aas wrote: On Mar 4, 2009, at 9:01 , Glenn Linderman wrote: On approximately 3/3/2009 11:22 PM, came the following characters from the keyboard of Raymond Hettinger: Perhaps the terminology should be ordereddict -- what we have here sorteddict -- hypothetical future type that keeps

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steve Holden
Tennessee Leeuwenburg wrote: > Hello all, > > First a comment on-thread: > I can't wait to get an ordered dictionary in the stdlib! The > discussion regarding suggestions for the name appears to be ongoing. > What about the name 'orderdict' instead of 'ordereddict'?. It doesn't > contain the dou

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Nick Coghlan
Tennessee Leeuwenburg wrote: > Hello all, > > First a comment on-thread: > I can't wait to get an ordered dictionary in the stdlib! The > discussion regarding suggestions for the name appears to be ongoing. > What about the name 'orderdict' instead of 'ordereddict'?. It doesn't > contain the dou

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steven D'Aprano
Glenn Linderman wrote: FIFOdict ? Yeah, that blows the capitalization scheme, way, way out. [...] It is suggestive of queue behavior, and the items are a queue if looked at from insertion, and traversal perspectives, if I understand correctly. Why is this relevant? Insertion and traversal

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Hrvoje Niksic
Steven D'Aprano wrote: Gisle Aas wrote: Instead of introducing a sorteddict I would instead suggest that the future should bring an odict with a sort method; possibly also keys_sorted and items_sorted methods. Instead of odict.sorted(), that can be spelled: sorted(odict) # sort the keys so

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steve Holden
Raymond Hettinger wrote: [...] > FWIW, PEP 372 has links to seven other independent implementations and > they all have names that are some variant spelling OrderedDict except > for one which goes by the mysterious name of StableDict. > > Am still +1 on painting the class green with pink polka dot

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Raymond Hettinger
Beware, deleting an item from an OrderedDict (in the current implementation) is O(N). Am I correct in presuming that that would not be true of .popitem? Yes. The popitem() method is O(1). Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steven D'Aprano
Gisle Aas wrote: Instead of introducing a sorteddict I would instead suggest that the future should bring an odict with a sort method; possibly also keys_sorted and items_sorted methods. Instead of odict.sorted(), that can be spelled: sorted(odict) # sort the keys sorted(odict.values()) #

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Tennessee Leeuwenburg
Hello all, First a comment on-thread: I can't wait to get an ordered dictionary in the stdlib! The discussion regarding suggestions for the name appears to be ongoing. What about the name 'orderdict' instead of 'ordereddict'?. It doesn't contain the double-d, is slightly shorter, and I think a l

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Gisle Aas
On Mar 4, 2009, at 9:01 , Glenn Linderman wrote: On approximately 3/3/2009 11:22 PM, came the following characters from the keyboard of Raymond Hettinger: Perhaps the terminology should be ordereddict -- what we have here sorteddict -- hypothetical future type that keeps its

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Steven D'Aprano
On Wed, 4 Mar 2009 05:23:33 pm Glenn Linderman wrote: > The problem with the ordereddict/OrderedDict/odict is that there > are way too many possible orderings, and without being more > specific (InsertionSequenceOrderPreservingDictionary) people are > doing to think "sort" when they hear "ordered".

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Glenn Linderman
On approximately 3/3/2009 11:22 PM, came the following characters from the keyboard of Raymond Hettinger: Perhaps the terminology should be ordereddict -- what we have here sorteddict -- hypothetical future type that keeps itself sorted in key order +1 -1 Introducing

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Terry Reedy
Guido van Rossum wrote: Beware, deleting an item from an OrderedDict (in the current implementation) is O(N). Am I correct in presuming that that would not be true of .popitem? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Raymond Hettinger
Perhaps the terminology should be ordereddict -- what we have here sorteddict -- hypothetical future type that keeps itself sorted in key order +1 FIFOdict ? Yeah, that blows the capitalization scheme, way, way out. Issues: * The popitem() method is LIFO. * In a non

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Glenn Linderman
On approximately 3/3/2009 4:51 PM, came the following characters from the keyboard of Greg Ewing: Terry Reedy wrote: I almost agree, except that the API uses the dict, not list, API. Yes, as long as the API is dict-like, it really needs to be thought of as a kind of dict. Perhaps the termino

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Guido van Rossum
On Tue, Mar 3, 2009 at 3:05 PM, Scott David Daniels wrote: > Forest wrote: >> >> On Tue, March 3, 2009 11:20 am, Forest wrote: >>> >>> Okay, but I'd also like a convenient and fast way to find the oldest >>> entry >>> in an OrderedDict, which I think I'd need for an LRU cache.  Skimming the >>> cu

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Greg Ewing
Terry Reedy wrote: I almost agree, except that the API uses the dict, not list, API. Yes, as long as the API is dict-like, it really needs to be thought of as a kind of dict. Perhaps the terminology should be ordereddict -- what we have here sorteddict -- hypothetical future type that k

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Scott David Daniels
Forest wrote: On Tue, March 3, 2009 11:20 am, Forest wrote: Okay, but I'd also like a convenient and fast way to find the oldest entry in an OrderedDict, which I think I'd need for an LRU cache. Skimming the current patch (od7.diff), I didn't notice one. Perhaps I simply missed something. Sho

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Terry Reedy
Greg Ewing wrote: Giovanni Bajo wrote: Just today, I was talking with a colleague (which is learning Python right now) about "ordered dict". His first thought was a dictionary that, when iterated, would return keys in sorted order. I wonder whether "indexed list" would be a more appropriate

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Forest
Raymond Hettinger wrote: > [Forest] >> Perhaps a new method like getfirst() would be worth while here? > > Guido already gave you a way to access the first item using the existing > API. > Using next(iter(d)) also works. Yep. I think messages are arriving out of order. -1 on my own suggestion.

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Greg Ewing
Giovanni Bajo wrote: Just today, I was talking with a colleague (which is learning Python right now) about "ordered dict". His first thought was a dictionary that, when iterated, would return keys in sorted order. I wonder whether "indexed list" would be a more appropriate name for what we're

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Raymond Hettinger
[Forest] Perhaps a new method like getfirst() would be worth while here? Guido already gave you a way to access the first item using the existing API. Using next(iter(d)) also works. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Forest
On Tue, March 3, 2009 11:20 am, Forest wrote: > Okay, but I'd also like a convenient and fast way to find the oldest entry > in an OrderedDict, which I think I'd need for an LRU cache. Skimming the > current patch (od7.diff), I didn't notice one. Perhaps I simply missed > something. Shouldn't po

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Raymond Hettinger
I recommend that you either make this a __private variable (signalling strongly that people shouldn't ever reference it), Will do. We want to make sure we can substitute a C implementation that has a completely different underlying structure (hash table plus a doubly linked list). Raymond

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Guido van Rossum
On Tue, Mar 3, 2009 at 12:02 PM, Raymond Hettinger wrote: > > [Forest] >> >> Okay, but I'd also like a convenient and fast way to find the oldest entry >> in an OrderedDict, which I think I'd need for an LRU cache.  Skimming the >> current patch (od7.diff), I didn't notice one.  Perhaps I simply m

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Forest
On Tue, March 3, 2009 11:54 am, Guido van Rossum wrote: > On Tue, Mar 3, 2009 at 11:20 AM, Forest wrote: >> Okay, but I'd also like a convenient and fast way to find the oldest >> entry >> in an OrderedDict, which I think I'd need for an LRU cache.  Skimming >> the >> current patch (od7.diff), I d

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Raymond Hettinger
[Forest] Okay, but I'd also like a convenient and fast way to find the oldest entry in an OrderedDict, which I think I'd need for an LRU cache. Skimming the current patch (od7.diff), I didn't notice one. Perhaps I simply missed something. Shouldn't popitem() allow the caller to choose which e

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Guido van Rossum
On Tue, Mar 3, 2009 at 11:20 AM, Forest wrote: > I'm looking forward to an ordered dictionary in the standard library, > especially for things like LRU caches.  I was just reading the PEP, and > caught this bit: > > "Does OrderedDict.popitem() return a particular key/value pair? > Yes. It pops-off

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Forest
I'm looking forward to an ordered dictionary in the standard library, especially for things like LRU caches. I was just reading the PEP, and caught this bit: "Does OrderedDict.popitem() return a particular key/value pair? Yes. It pops-off the most recently inserted new key and its corresponding v

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Ivan Krstić
On Mar 2, 2009, at 7:08 PM, Steve Holden wrote: PS.: so is datetime.datetime a builtin then? :) Another historic accident. Like socket.socket. :-( A pity this stuff wasn't addressed for 3.0. Way too late now, though. It may be too late to rename the existing accidents, but why not add co

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Giovanni Bajo
On Mon, 02 Mar 2009 14:36:32 -0800, Raymond Hettinger wrote: > [Nick Coghlan] >> The examples in the PEP used 'odict' (until recently), but the patch >> was for OrderedDict. > > As an experiment, try walking down the hall asking a few programmers who > aren't in this conversion what they think co

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Steve Holden
Guido van Rossum wrote: > On Mon, Mar 2, 2009 at 3:43 PM, Raymond Hettinger wrote: >> [GvR] >>> *Maybe* the "built-in status" should guide the >>> capitalization, so only built-in types are lowercase (str, int, dict >>> etc.). >> That makes sense. >> >> >>> Anyway, it seems the collections module

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Guido van Rossum
On Mon, Mar 2, 2009 at 3:52 PM, Raymond Hettinger wrote: > Quick question?  Is PEP 8 still current for what is being done in Py3.x? > I just took a quick look and it says: > >   Class Names > >     Almost without exception, class names use the CapWords convention. >     Classes for internal use ha

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Raymond Hettinger
- From: "Guido van Rossum" To: "Raymond Hettinger" Cc: ; "Armin Ronacher" Sent: Monday, March 02, 2009 3:38 PM Subject: Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement On Mon, Mar 2, 2009 at 3:13 PM, Raymond Hett

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Guido van Rossum
On Mon, Mar 2, 2009 at 3:43 PM, Raymond Hettinger wrote: > [GvR] >> >> *Maybe* the "built-in status" should guide the >> capitalization, so only built-in types are lowercase (str, int, dict >> etc.). > > That makes sense. > > >> Anyway, it seems the collections module in particular is already >> i

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Armin Ronacher
Hi, Guido van Rossum python.org> writes: > Anyway, it seems the collections module in particular is already > internally inconsistent -- NamedTuple vs. defaultdict. In a sense > defaultdict is the odd one out here, since these are things you import > from some module, they're not built-in. Maybe

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Raymond Hettinger
[GvR] *Maybe* the "built-in status" should guide the capitalization, so only built-in types are lowercase (str, int, dict etc.). That makes sense. Anyway, it seems the collections module in particular is already internally inconsistent -- NamedTuple vs. defaultdict. FWIW, namedtuple() is a

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Guido van Rossum
On Mon, Mar 2, 2009 at 3:13 PM, Raymond Hettinger wrote: > >> Unfortunately PEP 8 never really took off naming-wise, so we're mostly >> following >> the "reuse the naming scheme from existing code in the same module" rule, >> and I >> think there lowercase wins, thanks to defaultdict. > > Traditio

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Raymond Hettinger
Unfortunately PEP 8 never really took off naming-wise, so we're mostly following the "reuse the naming scheme from existing code in the same module" rule, and I think there lowercase wins, thanks to defaultdict. Traditionally, the all lowercase name referred to a C type. The other classes in

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Benjamin Peterson
2009/3/2 Armin Ronacher : > Hi, > > Raymond Hettinger rcn.com> writes: >> When we use the class, we typically only spell-out the constructor >> once while actually using the returned >> object many times.  So, >> have we really saved any typing? > I'm fine with the typed out name as well, but I st

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Martin v. Löwis
> Is it a class or function? What does it do? Can the English as second > language folks guess what the o stands for? Is it a builtin or pure > python? My guess is that the experiment will be informative. I'll do that tomorrow (if I manage to remember). My guess is that "ordered dictionary" is

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Raymond Hettinger
[Nick Coghlan] The examples in the PEP used 'odict' (until recently), but the patch was for OrderedDict. As an experiment, try walking down the hall asking a few programmers who aren't in this conversion what they think collections.odict() is? Is it a class or function? What does it do? Can

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Nick Coghlan
Raymond Hettinger wrote: >> /bikeshedding > > Yes. Also we need to paint it green with pink polka dots :-) Or should that be pink with green polka dots? ;) Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Nick Coghlan
Guido van Rossum wrote: > +1 for odict. Somehow I thought that was the name proposed by the PEP. :-( The examples in the PEP used 'odict' (until recently), but the patch was for OrderedDict. I don't personally mind either way. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisba

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Raymond Hettinger
/bikeshedding Yes. Also we need to paint it green with pink polka dots :-) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40m

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Dirkjan Ochtman
On 02/03/2009 22:28, Georg Brandl wrote: We're already quite inconsistent with type name casing in the collections module, so it wouldn't matter so much. (Though I'd find symmetry with defaultdict pleasing as well.) Since the odict naming is already so prevalent in the wild, it seems to me li

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Armin Ronacher
Steve Holden holdenweb.com> writes: > Surely that's just a thinko in the subject line? The PEP specifies > "ordered dictionary" and nobody has been talking about "directories". Actually, the initial version of the PEP had that typo in the topic. Guess I copy pasted wrong again: http://www.goog

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Armin Ronacher
Guido van Rossum python.org> writes: > +1 for odict. Somehow I thought that was the name proposed by the PEP. It originally was, Raymond wanted to change it. I would still vote for odict if that's still possible :) Regards, Armin ___ Python-Dev mai

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Benjamin Peterson
2009/3/2 Armin Ronacher : > Hi, > > Georg Brandl gmx.net> writes: > >> We're already quite inconsistent with type name casing in the collections >> module, so it wouldn't matter so much.  (Though I'd find symmetry with >> defaultdict pleasing as well.) > We either have the way to be consistent wit

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Steve Holden
Benjamin Peterson wrote: > 2009/3/1 Armin Ronacher : [...] >> The corresponding issue in the tracker: http://bugs.python.org/issue5397 >> Link to the PEP: http://www.python.org/dev/peps/pep-0372/ >> >> Anything else that should be done? > > Have you considered naming? I would think that "odict" or

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Armin Ronacher
Hi, Georg Brandl gmx.net> writes: > We're already quite inconsistent with type name casing in the collections > module, so it wouldn't matter so much. (Though I'd find symmetry with > defaultdict pleasing as well.) We either have the way to be consistent with defaultdict and dict or with Counte

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Guido van Rossum
On Mon, Mar 2, 2009 at 1:28 PM, Georg Brandl wrote: > Benjamin Peterson schrieb: >> 2009/3/1 Armin Ronacher : >>> Hi everybody, >>> >>> PEP 372 was modified so that it provides a simpler API (only the dict API >>> to be exact) and it was decided to start with a Python-only implementation >>> and r

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Georg Brandl
Benjamin Peterson schrieb: > 2009/3/1 Armin Ronacher : >> Hi everybody, >> >> PEP 372 was modified so that it provides a simpler API (only the dict API >> to be exact) and it was decided to start with a Python-only implementation >> and replace it with a C version later if necessary. >> >> Annotate

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-02 Thread Benjamin Peterson
2009/3/1 Armin Ronacher : > Hi everybody, > > PEP 372 was modified so that it provides a simpler API (only the dict API > to be exact) and it was decided to start with a Python-only implementation > and replace it with a C version later if necessary. > > Annotated changes from earlier versions of t

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-01 Thread Jean-Paul Calderone
On Sun, 1 Mar 2009 19:13:27 + (UTC), Armin Ronacher wrote: Hi everybody, PEP 372 was modified so that it provides a simpler API (only the dict API to be exact) and it was decided to start with a Python-only implementation and replace it with a C version later if necessary. Annotated chang

[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-01 Thread Armin Ronacher
Hi everybody, PEP 372 was modified so that it provides a simpler API (only the dict API to be exact) and it was decided to start with a Python-only implementation and replace it with a C version later if necessary. Annotated changes from earlier versions of the PEP: - the extra API for ordered