Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Georg Brandl
Guido van Rossum schrieb: > I haven't taken any action, and it looks like __cmp__ isn't being > called. I'd rather not add it back; if you want it back, could you at > least write up a brief PEP? A patch would also help; I recall that it > was quite a relief being able to cut it out, so I expect th

Re: [Python-3000] Revised PEP for buffer protocol

2007-03-21 Thread Nick Coghlan
Josiah Carlson wrote: > Nick Coghlan <[EMAIL PROTECTED]> wrote: >> Josiah Carlson wrote: >>> "Travis E. Oliphant" <[EMAIL PROTECTED]> wrote: The buffer interface should allow discontiguous memory areas to share standard striding information. However, consumers that do no

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Josiah Carlson
Georg Brandl <[EMAIL PROTECTED]> wrote: > Guido van Rossum schrieb: > > I haven't taken any action, and it looks like __cmp__ isn't being > > called. I'd rather not add it back; if you want it back, could you at > > least write up a brief PEP? A patch would also help; I recall that it > > was quit

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Georg Brandl
Josiah Carlson schrieb: > Georg Brandl <[EMAIL PROTECTED]> wrote: >> Guido van Rossum schrieb: >> > I haven't taken any action, and it looks like __cmp__ isn't being >> > called. I'd rather not add it back; if you want it back, could you at >> > least write up a brief PEP? A patch would also help;

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Guido van Rossum
On 3/21/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > BTW, was it intentional that dicts can't be compared via ">" and "<" > anymore? Yes. In old Python it made sense since all objects were supposed to be orderable *somehow* (in the truly distant past, comparisons weren't even allowed to raise exc

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Terry Reedy
"Georg Brandl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Yes, but dictionaries had an explicit ordering in dict_compare() which was | deleted. Is dict_compare something added in 2.5? It is neither a builtin or dict method in 2.4. In any case, this point is that dict order

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-21 Thread BJörn Lindqvist
No comments at all. :( Did I send the mail to the wrong list? Either or, I still would like to know what the py3k rules are for repairing broken API:s. On 3/14/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > I have a question about PEP 3001: > > """The last and most disruptive change is the ove

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Collin Winter
On 3/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: [snip] > Or we could just have 2.6 warn about the presence (or use) of __cmp__ > -- users can write equivalent code using __lt__ etc. themselves and > probably do a better job. Fair enough. Is anyone collecting a list of these --py3k warning

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-21 Thread Steven Bethard
On 3/14/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > So I wonder what is the policy for fixing mistakes in the API design? In general, I think if you can warn about it in 2.6 or you can add to 2to3 so that this gets automatically fixed, then it's okay to fix the API. > Is a PEP really needed?

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-21 Thread Terry Reedy
"BJörn Lindqvist" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | No comments at all. :( Did I send the mail to the wrong list? No, perhaps everyone did as I did, and assumed someone else would answer ;-) | Either or, I still would like to know what the py3k rules are for | repai

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Adam Olsen
On 3/20/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 3/20/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > Quoting from the commit message for r51533, which removed the default > > ordering: > > > > """ > > A general problem with getting lots of these tests to pass is > > the reality that fo

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Adam Olsen
On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > [snip] > > Or we could just have 2.6 warn about the presence (or use) of __cmp__ > > -- users can write equivalent code using __lt__ etc. themselves and > > probably do a better job. > >

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Steven Bethard
On 3/21/07, Adam Olsen <[EMAIL PROTECTED]> wrote: > On 3/20/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > I've used a __key__() method quite successfully in my own code. Maybe > > we should provide a mixin like:: > > > > class KeyedComparisonMixin(object): > > def __eq__(self, othe

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Thomas Wouters
On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: On 3/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: [snip] > Or we could just have 2.6 warn about the presence (or use) of __cmp__ > -- users can write equivalent code using __lt__ etc. themselves and > probably do a better job. Fair enou

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Collin Winter
On 3/21/07, Thomas Wouters <[EMAIL PROTECTED]> wrote: > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 3/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > [snip] > > > Or we could just have 2.6 warn about the presence (or use) of __cmp__ > > > -- users can write equivalent code us

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Georg Brandl
Terry Reedy schrieb: > "Georg Brandl" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Yes, but dictionaries had an explicit ordering in dict_compare() which > was > | deleted. > > Is dict_compare something added in 2.5? It is neither a builtin or dict > method in 2.4. No, it

Re: [Python-3000] refleaks and other errors

2007-03-21 Thread Guido van Rossum
Thanks, got it. Found the leak, thanks to gc.get_objects() and your hint about what was leaking in test_grammar. Were you tired when you posted that first msg? It was incredibly terse. :-) Committed revision 54502. --Guido On 3/20/07, Neal Norwitz <[EMAIL PROTECTED]> wrote: > That was mostly the

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Guido van Rossum
On 3/21/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > Terry Reedy schrieb: > > "Georg Brandl" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > | Yes, but dictionaries had an explicit ordering in dict_compare() which > > was > > | deleted. > > > > Is dict_compare something added i

[Python-3000] Fwd: Re: Total ordering and __cmp__

2007-03-21 Thread Raymond Hettinger
[Guido van Rossum] >It was well-defined because I had to do *something* that depended only >on the keys and values and not on object identities etc. I never >considered it *userful* and I don't know of anyone who used it. Also, dict ordering would be confusing in Py3k where the views use the ineq

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Greg Ewing
Adam Olsen wrote: > On 3/20/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > > I've used a __key__() method quite successfully in my own code. Maybe > > we should provide a mixin like:: > > This seems to match what I've usually needed, but I'm not sure it's > worth putting in python proper. In

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Daniel Stutzbach
On 3/21/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > In addition to this, what about the idea of a Python-level > __richcmp__ method? It would provide a single point of override > for classes that wanted to use it, and it shouldn't upset any > default behaviours since it's just exposing what's there

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-21 Thread BJörn Lindqvist
On 3/21/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 3/14/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > So I wonder what is the policy for fixing mistakes in the API design? > > In general, I think if you can warn about it in 2.6 or you can add to > 2to3 so that this gets automatically f

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Collin Winter
On 3/21/07, brett.cannon wrote: > Author: brett.cannon > Date: Wed Mar 21 23:26:20 2007 > New Revision: 54510 > > Modified: >python/branches/p3yk/Lib/ConfigParser.py >python/branches/p3yk/Lib/test/test_file.py > Log: > When removing indexing/slicing on exceptions some places were changed >

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Guido van Rossum
On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/21/07, brett.cannon wrote: > > When removing indexing/slicing on exceptions some places were changed > > inappropriately from ``e[0]`` to ``e.message`` instead of ``e.args[0]``. > > The > > reason it needs to be the last option is the d

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-21 Thread BJörn Lindqvist
On 3/21/07, Terry Reedy <[EMAIL PROTECTED]> wrote: > "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | No comments at all. :( Did I send the mail to the wrong list? > > No, perhaps everyone did as I did, and assumed someone else would answer > ;-) I see.. Thanks f

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Collin Winter
On 3/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 3/21/07, brett.cannon wrote: > > > When removing indexing/slicing on exceptions some places were changed > > > inappropriately from ``e[0]`` to ``e.message`` instead of ``e.args[0]

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Brett Cannon
On 3/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 3/21/07, brett.cannon wrote: > > > When removing indexing/slicing on exceptions some places were changed > > > inappropriately from ``e[0]`` to ``e.message`` instead of ``e.args[0]

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Brett Cannon
On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > > On 3/21/07, brett.cannon wrote: > > > > When removing indexing/slicing on exceptions some places were changed > > > > inappr

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Collin Winter
On 3/21/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 3/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > > > On 3/21/07, brett.cannon wrote: > > > > > When removing indexing

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Guido van Rossum
PDFL? Petty Dictator For Life? Poodle Dictator For Life? Perhaps Dictator For Life? :-) I suggest that you update the PEP and then repost the pep on python-dev with a summary of the changes (to the PEP). I expect it to go smoothly. --Guido On 3/21/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > On

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Brett Cannon
On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/21/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > > On 3/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > > On 3/21/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > > > > On

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Brett Cannon
On 3/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > PDFL? Petty Dictator For Life? Poodle Dictator For Life? Perhaps > Dictator For Life? :-) > =) Hey, I'm sick so I get to have a typo or four. > I suggest that you update the PEP and then repost the pep on > python-dev with a summary of th

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Terry Reedy
Terry Reedy schrieb: | > In any case, this point is that dict ordering is as arbitrary as ordering, | > for instance, a dict and a string. Since Guido stopped the experiment of | > totally ordering all objects when complex nums were added, consistency | > suggests that all fake orderings be el

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Greg Ewing
Daniel Stutzbach wrote: > I apologize if this is a silly question, but what would be the > difference between the proposed __richcmp__ and the old __cmp__ that's > being removed? __richcmp__ would have the same signature as the C-level tp_richcmp slot, i.e. taking a code indicating which comparis

Re: [Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py

2007-03-21 Thread Greg Ewing
Brett Cannon wrote: > Should we just consider this a PDFL pronouncement, Interesting acronym... Portable Documentator For Life, maybe? -- Greg Ewing, Computer Science Dept, +--+ University of Canterbury, | Carpe

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-21 Thread Steven Bethard
On 3/21/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On 3/21/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > On 3/14/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > > So I wonder what is the policy for fixing mistakes in the API design? > > > > In general, I think if you can warn about it