[Python-3000] Revised PEP for buffer protocol

2007-03-20 Thread Travis E. Oliphant
Attached is my revised PEP for the buffer protocol after incorporating suggestions from Greg Ewing. It is as simple as I can make it and still share what I think needs to be sharable. Suggestions are welcome. I will provide and maintain code to implement the PEP when the basic idea of t

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

2007-03-20 Thread Josiah Carlson
"Travis E. Oliphant" <[EMAIL PROTECTED]> wrote: > abstractly as if it were. I believe, the PIL is where the idea of > multiple buffer segments in the original buffer interface came > from, I believe. Remove the last "I believe" in that sentence and remove the commas. ;) > The buf

Re: [Python-3000] 2to3 fixers

2007-03-20 Thread Brett Cannon
On 3/19/07, Collin Winter <[EMAIL PROTECTED]> wrote: > Hi all, > > I've added two new fixers to 2to3 this weekend, plus significant new > functionality for a third: > > * fix_next handles the it.next() -> next(it) transition for PEP 3114. > * fix_nonzero converts __nonzero__ to __bool__ methods, as

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

2007-03-20 Thread Nick Coghlan
Josiah Carlson wrote: > "Travis E. Oliphant" <[EMAIL PROTECTED]> wrote: >> abstractly as if it were. I believe, the PIL is where the idea of >> multiple buffer segments in the original buffer interface came >> from, I believe. > > Remove the last "I believe" in that sentence and remove

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

2007-03-20 Thread Greg Ewing
Nick Coghlan wrote: > I think the point is for there to be something in the standard library > or Python core that makes it easy for a consumer to *copy* the data to a > contiguous memory segment in the event the consumer can't directly > handle non-contiguous data It would be even more useful

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

2007-03-20 Thread Josiah Carlson
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 > >> not want to deal with stri

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

2007-03-20 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > > Nick Coghlan wrote: > > > I think the point is for there to be something in the standard library > > or Python core that makes it easy for a consumer to *copy* the data to a > > contiguous memory segment in the event the consumer can't directly > > ha

[Python-3000] Automated py3k doc builds

2007-03-20 Thread Collin Winter
I just discovered that the p3yk/ branch can't do a docs build because almost none of the code in Doc/tools/ is valid Python 3 [1]. How hard would it be to set up something akin to http://docs.python.org/dev/ for p3yk (ie, regular, automated builds), if only to catch problems like this sooner? Coll

Re: [Python-3000] Automated py3k doc builds

2007-03-20 Thread Brett Cannon
On 3/20/07, Collin Winter <[EMAIL PROTECTED]> wrote: > I just discovered that the p3yk/ branch can't do a docs build because > almost none of the code in Doc/tools/ is valid Python 3 [1]. How hard > would it be to set up something akin to http://docs.python.org/dev/ > for p3yk (ie, regular, automat

[Python-3000] Total ordering and __cmp__

2007-03-20 Thread Collin Winter
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 for object types that have a natural total ordering, implementing __cmp__ is much more convenient than implementing __eq__, __ne__, __l

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Guido van Rossum
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 that patching it back in would be qu

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Terry Reedy
"Collin Winter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Quoting from the commit message for r51533, which removed the default ordering: | | What's the status on this? FWIW, I would like to see __cmp__ stay as a | fallback measure if __eq__, __ne__, __lt__, etc aren't define

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Guido van Rossum
But can this work? It might end up calling cmp() on two incomparable objects. For __lt__ etc. that might be the right answer, but for __eq__ it is *not* -- the default __eq__ and __ne__ *must* compare object identity. (What is this __cmp you refer to? A typo for __cmp__ or for cmp?) --Guido On 3

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Steven Bethard
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 for object types that have a natural total ordering, > implementing __

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Guido van Rossum
How would that produce the desired behavior that == and != are defined on all objects, but <, <=, >= and > are not? We're quickly approaching python-ideas land... :) On 3/20/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 3/20/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > Quoting from the co

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Collin Winter
On 3/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > 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

Re: [Python-3000] Automated py3k doc builds

2007-03-20 Thread Neal Norwitz
http://docs.python.org/dev/3.x/ will be updated every hour. http://docs.python.org/dev/3.x/results/ contains the results of the last build. n -- On 3/20/07, Collin Winter <[EMAIL PROTECTED]> wrote: > I just discovered that the p3yk/ branch can't do a docs build because > almost none of the cod

Re: [Python-3000] Automated py3k doc builds

2007-03-20 Thread Collin Winter
On 3/20/07, Neal Norwitz <[EMAIL PROTECTED]> wrote: > http://docs.python.org/dev/3.x/ > > will be updated every hour. > > http://docs.python.org/dev/3.x/results/ > > contains the results of the last build. Woohoo! Thanks, Neal! ___ Python-3000 mailing li

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Guido van Rossum
On 3/20/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > 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 woul

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Steven Bethard
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, other): > return self.__key__() == other.__key__() [sn

Re: [Python-3000] Total ordering and __cmp__

2007-03-20 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | But can this work? It might end up calling cmp() on two incomparable | objects. For __lt__ etc. that might be the right answer, but for | __eq__ it is *not* -- the default __eq__ and __ne__ *must* compare | object id

[Python-3000] refleaks and other errors

2007-03-20 Thread Neal Norwitz
regrtest.py -R 4:3: # on 64-bit, but that might only affect the xpickle error test_grammar leaked [14, 14, 14] references test_doctest leaked [84, 84, 84] references test_ctypes leaked [13, 13, 13] references test_descrtut leaked [417, 417, 417] references test_generators leaked [227, 227, 227] r

Re: [Python-3000] refleaks and other errors

2007-03-20 Thread Guido van Rossum
I'm pretty sure I introduced leaks with the new metaclass code; it was a bit of a rush job and there's plenty of new C code. I need a hint on how to reproduce this myself for a single test... On 3/20/07, Neal Norwitz <[EMAIL PROTECTED]> wrote: > regrtest.py -R 4:3: # on 64-bit, but that might onl

Re: [Python-3000] refleaks and other errors

2007-03-20 Thread Neal Norwitz
That was mostly the first line of my message, although it was a bit terse. :-) It's just a cmd line option to regrtest.py -R 4:3: Everything else is the same. The way I run it for test_grammar: ./python -E -tt ./Lib/test/regrtest.py -R 4:3: test_grammar You can also pass "-R ::" instead of "-R