Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Nadeem Vawda
On Sat, Mar 12, 2011 at 9:32 AM, Eli Bendersky eli...@gmail.com wrote: The devguide's recommendation is to forward-port changes withing a major release line, i.e. if I need something in all 3.[123], then start with 3.1 and forward-port (by hg merge branch) to 3.2 and then 3.3 Just to clarify

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Antoine Pitrou
Hello, I recall several occasions where the peephole optimizer was subtly buggy -- on one occasion the bug remained undetected for at least a whole release cycle. (Sorry, I can't recall the details.) In fact, the bug reported in http://bugs.python.org/issue11244 is another example of how

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Mark Dickinson
FWIW, I'm -1 on backing out Antoine's patch. In addition to fixing the minor optimization regression, it makes the peepholer significantly more consistent in what it can and can't fold. One of the first times that I delved into the peepholer code was to try to understand why expressions like: 2

Re: [Python-Dev] The purpose of SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP

2011-03-12 Thread Antoine Pitrou
Hello, Am I missing something? Does SETUP_LOOP serve any other purpose? Not to my knowledge. Similarly, it looks like BREAK_LOOP and CONTINUE_LOOP are just jumps that respect try/finally blocks (i.e. jumping out of try executes finally). Is there more semantics to them than this? There

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 5:07 AM, Mark Dickinson dicki...@gmail.com wrote: I can also see the case for ripping out the peepholer entirely.  But reverting Antoine's patch seems like a step backwards. +1 to what Mark says here. If the day comes when the peepholer can be ripped out in favour of

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Martin v. Löwis
Am 12.03.11 04:03, schrieb Nadeem Vawda: Hmm... it seems that the given instructions don't actually work. hg revert -a fails, saying that a specific revision needs to be provided. The command should be hg revert -ar default. Isn't that command correct only if you are merging into default? ISTM

Re: [Python-Dev] public visibility of python-dev decisions before it's too late (was: PyCObject_AsVoidPtr removed from python 3.2 - is this documented?)

2011-03-12 Thread Doug Hellmann
On Mar 11, 2011, at 7:12 PM, Paul Moore wrote: On 11 March 2011 23:24, Guido van Rossum gu...@python.org wrote: I'm interested in the task and I guess I'll follow-up with Doug Hellman. I don't follow -ideas close enough to summarize it, but I'd contribute to a -dev blog. Awesome! (And we

[Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Nick Coghlan
I posted my rough notes and additional write-ups for Wednesday's VM summit and Thursday's language summit: http://www.boredomandlaziness.org/2011/03/python-vm-summit-rough-notes.html http://www.boredomandlaziness.org/2011/03/python-vm-summit-somewhat-coherent.html

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread John Arbash Meinel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ... I have always felt uncomfortable with *any* kind of optimization -- whether AST-based or bytecode-based. I feel the cost in code complexity is pretty high and in most cases the optimization is not worth the effort. Also I don't see the point

Re: [Python-Dev] The purpose of SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP

2011-03-12 Thread Eugene Toder
There are also with blocks :-) (which use separate opcodes, although they are similar in principle to try/finally blocks) IIUC they use separate opcode, but the same block type (SETUP_FINALLY). There may be complications with nested try/finally blocks. You either need to generate separate

[Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Laura Creighton
For those of you not at the Language Summit at PyCON the day before yesterday, there was talk of identifying non-portable behaviour, such as relying on CPython's reference counting garbage collector to close files for you as soon as they become unreachable. And then warning about them. We have a

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 8:33 AM, Laura Creighton l...@openend.se wrote: For those of you not at the Language Summit at PyCON the day before yesterday, there was talk of identifying non-portable behaviour, such as relying on CPython's reference counting garbage collector to close files for you

[Python-Dev] Python 3.4 version in the tracker

2011-03-12 Thread Eric Smith
Could someone with the right access add a Python 3.4 version to the tracker? I have a deprecation warning that I need to make an error in 3.4. I'd also like to make it a release blocker in 3.4 so I don't forget about it. If I do that, will it screw up any release workflow? Thanks.

[Python-Dev] Introductions

2011-03-12 Thread Ross Lagerwall
Hi, I have been offered commit rights for Python after making a few patches on subprocess and the os module. Antoine suggested that I should introduce myself on the python-dev list so here we go: I am a student from South Africa and decided to do some work on Python in my spare time. I think I

Re: [Python-Dev] Python 3.4 version in the tracker

2011-03-12 Thread Martin v. Löwis
Am 12.03.11 09:26, schrieb Eric Smith: Could someone with the right access add a Python 3.4 version to the tracker? Done. I'd also like to make it a release blocker in 3.4 so I don't forget about it. If I do that, will it screw up any release workflow? I don't think so. As release managers

Re: [Python-Dev] Python 3.4 version in the tracker

2011-03-12 Thread Éric Araujo
I have a deprecation warning that I need to make an error in 3.4. A neat trick to remember to do those changes is using a test that fails if something does not raise a DeprecationWarning if sys.version_info[:2] == (3, 3), or an error if sys.version_info[:3] == (3, 4). You write those tests once

[Python-Dev] Builtin open() too slow

2011-03-12 Thread Lukas Lueg
Hi, i've a storage engine that stores a lot of files (e.g. 10.000) in one path. Running the code under cProfile, I found that with a total CPU-time of 1,118 seconds, 121 seconds are spent in 27.013 calls to open(). The number of calls is not the problem; however I find it *very* discomforting

Re: [Python-Dev] Python 3.4 version in the tracker

2011-03-12 Thread Antoine Pitrou
On Sat, 12 Mar 2011 16:55:30 +0100 Éric Araujo mer...@netwok.org wrote: I have a deprecation warning that I need to make an error in 3.4. A neat trick to remember to do those changes is using a test that fails if something does not raise a DeprecationWarning if sys.version_info[:2] == (3,

Re: [Python-Dev] Builtin open() too slow

2011-03-12 Thread Eugene Toder
Hi What OS and what file system you are using? Many file systems (e,g. ext2/3fs) handle large directories very poorly. A quick way to check if this has anything to do with Python is writing a small C program that opens these files and time it. Eugene On Sat, Mar 12, 2011 at 10:13 AM, Lukas Lueg

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Raymond Hettinger
There are separate social, strategic, and tactical questions. The social question: if the person who designed, implemented, and maintained the optimizer recommends against a patch and another committer just checks it in anyway, do we care? I've taken responsibility for this code and have

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Éric Araujo
Hi, I posted my rough notes and additional write-ups for Wednesday's VM summit and Thursday's language summit: Thanks for doing that! About this bit from the VM meeting notes: - original Python-on-Parrot ran into problems due to semantic mismatches between Perl 6 and Python - reached the

Re: [Python-Dev] Python 3.4 version in the tracker

2011-03-12 Thread Eric Smith
On 03/12/2011 10:55 AM, Éric Araujo wrote: I have a deprecation warning that I need to make an error in 3.4. A neat trick to remember to do those changes is using a test that fails if something does not raise a DeprecationWarning if sys.version_info[:2] == (3, 3), or an error if

Re: [Python-Dev] Builtin open() too slow

2011-03-12 Thread Christian Heimes
Am 12.03.2011 16:13, schrieb Lukas Lueg: i've a storage engine that stores a lot of files (e.g. 10.000) in one path. Running the code under cProfile, I found that with a total CPU-time of 1,118 seconds, 121 seconds are spent in 27.013 calls to open(). The number of calls is not the problem;

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 11:08 AM, Éric Araujo mer...@netwok.org wrote: Hi, I posted my rough notes and additional write-ups for Wednesday's VM summit and Thursday's language summit: Thanks for doing that! About this bit from the VM meeting notes:  - original Python-on-Parrot ran into

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Raymond Hettinger
I would like to withdraw my suggestion for the recursive constant folding patch to be reverted. I value social harmony much more than a decision about whether a particular patch is a good idea. I apologize to anyone who is upset over the discussion. Raymond

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Martin v. Löwis
http://www.boredomandlaziness.org/2011/03/python-vm-summit-rough-notes.html http://www.boredomandlaziness.org/2011/03/python-vm-summit-somewhat-coherent.html Wrt. the remark that other implementations should be referenced more prominently: I added them to http://www.python.org/download/

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Guido van Rossum
On Sat, Mar 12, 2011 at 8:59 AM, Nick Coghlan ncogh...@gmail.com wrote: On Sat, Mar 12, 2011 at 8:33 AM, Laura Creighton l...@openend.se wrote: For those of you not at the Language Summit at PyCON the day before yesterday, there was talk of identifying non-portable behaviour, such as relying

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Allison Randal
On 03/12/2011 11:17 AM, Nick Coghlan wrote: About this bit from the VM meeting notes: - original Python-on-Parrot ran into problems due to semantic mismatches between Perl 6 and Python - reached the limits of the degree of difference the Perl 6 toolchain was willing to tolerate) Would you

Re: [Python-Dev] Introductions

2011-03-12 Thread Guido van Rossum
Welcome Ross! Glad you like the new dev guide. (Brett and the community should be proud of their recent work on that.) Remember, there are no stupid questions. And while occasionally it may appear as if someone tries to bite your head off, our bite is not as bad as our bark. --Guido On Sat, Mar

Re: [Python-Dev] Introductions

2011-03-12 Thread Terry Reedy
On 3/12/2011 9:41 AM, Ross Lagerwall wrote: Hi, I have been offered commit rights for Python after making a few patches on subprocess and the os module. Antoine suggested that I should introduce myself on the python-dev list so here we go: I am a student from South Africa and decided to do

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Maciej Fijalkowski
On Sat, Mar 12, 2011 at 1:14 PM, Martin v. Löwis mar...@v.loewis.de wrote: http://www.boredomandlaziness.org/2011/03/python-vm-summit-rough-notes.html http://www.boredomandlaziness.org/2011/03/python-vm-summit-somewhat-coherent.html Wrt. the remark that other implementations should be

Re: [Python-Dev] The purpose of SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP

2011-03-12 Thread P.J. Eby
At 08:25 AM 3/12/2011 -0500, Eugene Toder wrote: Right, I'm not suggesting to remove all blocks, only SETUP_LOOP blocks. Do you see the problem in that case? I think you guys are forgetting about FOR_ITER, listcomps, and the like. That is, IIRC, the reason loops use the block stack is because

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 1:41 PM, Guido van Rossum gu...@python.org wrote: Yeah, indeed, on everything you said. The code dispatching based on internal slots is horribly ad-hoc and likely wrong in subtle ways. Has any of this improved in Python 3? Not that I know of - I was definitely able to

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Terry Reedy
On 3/12/2011 8:59 AM, Nick Coghlan wrote: On Sat, Mar 12, 2011 at 8:33 AM, Laura Creightonl...@openend.se wrote: For those of you not at the Language Summit at PyCON the day before yesterday, there was talk of identifying non-portable behaviour, such as relying on CPython's reference counting

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Thomas Wouters
On Sat, Mar 12, 2011 at 14:52, Terry Reedy tjre...@udel.edu wrote: On 3/12/2011 8:59 AM, Nick Coghlan wrote: (obviously, history now means that changing our behaviour would require a deprecation period) I disagree. Behavior that contradicts intent and doc is a bug and should be fixed.

[Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Guido van Rossum
I was just reminded that in Python 3, list.sort() and sorted() no longer support the cmp (comparator) function argument. The reason is that the key function argument is always better. But now I have a nagging doubt about this: I recently advised a Googler who was sorting a large dataset and

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Terry Reedy
On 3/12/2011 3:04 PM, Thomas Wouters wrote: It should be fixed, yes, but breaking existing code is going to piss off a lot of people (like me) who already have enough worries when upgrading Python. It is apparent that there *is* code out there that relies on this behaviour, we shouldn't break

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Antoine Pitrou
Hello, Finally: There appears to be some disagreement on who said what, in particular Raymond claims that he told Antoine not to commit whereas Antoine claims he did not hear this feedback. I'm guessing it happened in IRC (#python-dev), which is intentionally not logged anywhere. Raymond

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Terry Reedy
On 3/12/2011 8:33 AM, Laura Creighton wrote: The thread with the whole gory details begins here: http://codespeak.net/pipermail/pypy-dev/2011q1/006958.html The second, multiplication issue does appears to be the same issue. Augmenting my previous test: class C(object): def

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Antoine Pitrou
On Sat, 12 Mar 2011 13:08:26 -0500 Raymond Hettinger raymond.hettin...@gmail.com wrote: I would like to withdraw my suggestion for the recursive constant folding patch to be reverted. I value social harmony much more than a decision about whether a particular patch is a good idea. I

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Reid Kleckner
They should be able to use a slotted cmp_to_key style class: http://docs.python.org/howto/sorting.html That will allocate 1 Python object with no dict per key, but that might not be good enough. Reid On Sat, Mar 12, 2011 at 3:44 PM, Guido van Rossum gu...@python.org wrote: I was just reminded

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Fredrik Johansson
On Sat, Mar 12, 2011 at 9:44 PM, Guido van Rossum gu...@python.org wrote: I was just reminded that in Python 3, list.sort() and sorted() no longer support the cmp (comparator) function argument. The reason is that the key function argument is always better. But now I have a nagging doubt about

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 4:50 PM, Reid Kleckner reid.kleck...@gmail.com wrote: They should be able to use a slotted cmp_to_key style class: http://docs.python.org/howto/sorting.html That will allocate 1 Python object with no dict per key, but that might not be good enough. Tuples are already

Re: [Python-Dev] Callable, non-descriptor class attributes.

2011-03-12 Thread Greg Ewing
Guido van Rossum wrote: IIUC Thomas found that this breaks some current use of staticmethod. I*I*UC, it wasn't making it callable that was the problem, it was changing the behaviour so that the staticmethod wrapper returns itself instead of the underlying object when accessed as a descriptor.

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Terry Reedy
On 3/12/2011 3:44 PM, Guido van Rossum wrote: I was just reminded that in Python 3, list.sort() and sorted() no longer support the cmp (comparator) function argument. The reason is that the key function argument is always better. But now I have a nagging doubt about this: I recently advised a

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Reid Kleckner
On Sat, Mar 12, 2011 at 4:58 PM, Nick Coghlan ncogh...@gmail.com wrote: On Sat, Mar 12, 2011 at 4:50 PM, Reid Kleckner reid.kleck...@gmail.com wrote: They should be able to use a slotted cmp_to_key style class: http://docs.python.org/howto/sorting.html That will allocate 1 Python object

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Glenn Linderman
On 3/12/2011 10:42 AM, Allison Randal wrote: I might convert it directly into a QA blog post. I'd like to see that, or a summary, posted here. As a Perl-to-Python convertee, I'm curious about the problematic semantic differences. ___ Python-Dev

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Nadeem Vawda
On Sat, Mar 12, 2011 at 1:29 PM, Martin v. Löwis mar...@v.loewis.de wrote: Isn't that command correct only if you are merging into default? ISTM that it should be hg revert -ar targetbranch. In general, yes. However, the existing text refers specifically to the case of merging 3.2 into default,

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Eugene Toder
Can sort have an option (and/or try to figure it itself) to calculate key for every comparison instead of caching them? This will have the same memory requirements as with cmp, but doesn't require rewriting code if you decide to trade speed for memory. Will this be much slower than with cmp? If

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Antoine Pitrou
On Sun, 13 Mar 2011 00:24:07 +0200 Nadeem Vawda nadeem.va...@gmail.com wrote: On Sat, Mar 12, 2011 at 1:29 PM, Martin v. Löwis mar...@v.loewis.de wrote: Isn't that command correct only if you are merging into default? ISTM that it should be hg revert -ar targetbranch. In general, yes.

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Martin v. Löwis
Am 12.03.11 16:58, schrieb Nick Coghlan: On Sat, Mar 12, 2011 at 4:50 PM, Reid Klecknerreid.kleck...@gmail.com wrote: They should be able to use a slotted cmp_to_key style class: http://docs.python.org/howto/sorting.html That will allocate 1 Python object with no dict per key, but that might

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Benjamin Peterson
2011/3/12 Maciej Fijalkowski fij...@gmail.com: On Sat, Mar 12, 2011 at 1:14 PM, Martin v. Löwis mar...@v.loewis.de wrote: http://www.boredomandlaziness.org/2011/03/python-vm-summit-rough-notes.html http://www.boredomandlaziness.org/2011/03/python-vm-summit-somewhat-coherent.html Wrt. the

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Peter Otten
Guido van Rossum wrote: I was just reminded that in Python 3, list.sort() and sorted() no longer support the cmp (comparator) function argument. The reason is that the key function argument is always better. But now I have a nagging doubt about this: I recently advised a Googler who was

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Éric Araujo
hg revert -ar default You can’t combine the -r option with other options. (Yes, it’s a known bug.) On an unrelated note, you can use “-r .” to tell Mercurial to find the branch name from the working directory instead of having to remember and retype it. Regards

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 5:41 PM, Martin v. Löwis mar...@v.loewis.de wrote: Why not? IIUC, the current key function creates three objects: the tuple, the short string, and the int. With the class Yeah, I misread the example. Using cmp_to_key would indeed save quite a lot of memory in this case.

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Martin v. Löwis
But in Python 3 this solution is no longer available. How bad is that? I'm not sure. But I'd like to at least get the issue out in the open. Rather than reintroducing cmp=, I'd add a cached=True parameter. If this is set to False, the key results wouldn't be put into a list, but recreated every

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Nadeem Vawda
On Sun, Mar 13, 2011 at 12:43 AM, Éric Araujo mer...@netwok.org wrote: hg revert -ar default You can’t combine the -r option with other options.  (Yes, it’s a known bug.) It seems to work for me (Mercurial 1.6.3 on Ubuntu). But I suppose it wouldn't hurt to split the options up. Regards,

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Glenn Linderman
On 3/12/2011 1:55 PM, Fredrik Johansson wrote: Consider sorting a list of pairs representing fractions. This can be done easily in Python 2.x with the comparison function lambda (p,q),(r,s): cmp(p*s, q*r). In Python 2.6, this is about 40 times faster than using fractions.Fraction as a key

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Antoine Pitrou
On Sat, 12 Mar 2011 23:43:52 +0100 Éric Araujo mer...@netwok.org wrote: hg revert -ar default You can’t combine the -r option with other options. (Yes, it’s a known bug.) Are you sure? It just worked here: $ hg rev -ar default reverting README (perhaps you're thinking of -R instead?)

Re: [Python-Dev] Callable, non-descriptor class attributes.

2011-03-12 Thread Thomas Wouters
On Sat, Mar 12, 2011 at 17:08, Greg Ewing greg.ew...@canterbury.ac.nzwrote: Guido van Rossum wrote: IIUC Thomas found that this breaks some current use of staticmethod. I*I*UC, it wasn't making it callable that was the problem, it was changing the behaviour so that the staticmethod

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Glenn Linderman
On 3/12/2011 3:43 AM, Nick Coghlan wrote: I posted my rough notes and additional write-ups for Wednesday's VM summit and Thursday's language summit: http://www.boredomandlaziness.org/2011/03/python-vm-summit-rough-notes.html 2.7 to 3.2 - treat PyPy Python 3 dialect like a major Python

Re: [Python-Dev] forward-porting from 3.1 to 3.2 to 3.3

2011-03-12 Thread Éric Araujo
You can’t combine the -r option with other options. (Yes, it’s a known bug.) Are you sure? It just worked here: [...] (perhaps you're thinking of -R instead?) Exactly. On an unrelated note, you can use “-r .” to tell Mercurial to find the branch name from the working directory instead of

Re: [Python-Dev] Introductions

2011-03-12 Thread Ned Deily
In article 1299940862.1632.7.camel@hobo, Ross Lagerwall rosslagerw...@gmail.com wrote: I have been offered commit rights for Python after making a few patches on subprocess and the os module. Antoine suggested that I should introduce myself on the python-dev list so here we go: I am a

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Nick Coghlan
On Sat, Mar 12, 2011 at 6:04 PM, Glenn Linderman v+pyt...@g.nevcal.com wrote: On 3/12/2011 3:43 AM, Nick Coghlan wrote: I posted my rough notes and additional write-ups for Wednesday's VM summit and Thursday's language summit:

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Greg Ewing
Nick Coghlan wrote: I'm actually tempted to call the current CPython semantics flatout *wrong*. So am I. It seems to result from the hisorical mess of distinguishing between numeric and sequence operations at the C level but not the Python level. I think CPython should be moving in the

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Martin v. Löwis
Am 12.03.11 18:00, schrieb Glenn Linderman: On 3/12/2011 1:55 PM, Fredrik Johansson wrote: Consider sorting a list of pairs representing fractions. This can be done easily in Python 2.x with the comparison function lambda (p,q),(r,s): cmp(p*s, q*r). In Python 2.6, this is about 40 times

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-12 Thread Allison Randal
On 03/12/2011 05:13 PM, Glenn Linderman wrote: On 3/12/2011 10:42 AM, Allison Randal wrote: I might convert it directly into a QA blog post. I'd like to see that, or a summary, posted here. As a Perl-to-Python convertee, I'm curious about the problematic semantic differences. The short

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Fredrik Johansson
On Sun, Mar 13, 2011 at 12:41 AM, Martin v. Löwis mar...@v.loewis.de wrote: Am 12.03.11 18:00, schrieb Glenn Linderman:  On 3/12/2011 1:55 PM, Fredrik Johansson wrote: Consider sorting a list of pairs representing fractions. This can be done easily in Python 2.x with the comparison function

Re: [Python-Dev] Callable, non-descriptor class attributes.

2011-03-12 Thread Terrence Cole
On Sat, 2011-03-12 at 12:49 +1300, Greg Ewing wrote: Thomas Wouters wrote: 2. Make CFunctions turn into methods in CPython (after a period of warning about the impending change, obviously.) The actual *usecase* for this is hard to envision While not necessary for the case being

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread skip
Raymond The social question:  if the person who designed, implemented, Raymond and maintained the optimizer recommends against a patch and Raymond another committer just checks it in anyway, do we care? Guido - you're dangerously close here to putting your ego ahead of Guido

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Martin v. Löwis
Maybe, but we have historically tended to give some extra weight to the primary author of at least modules and packages. If someone wanted to make a significant change to xml.etree, I think we would give reasonably large weight to Fredrik Lundh's opinion on the change. If the peephole optimizer

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Terry Reedy
On 3/12/2011 5:09 PM, Reid Kleckner wrote: On Sat, Mar 12, 2011 at 4:58 PM, Nick Coghlanncogh...@gmail.com wrote: On Sat, Mar 12, 2011 at 4:50 PM, Reid Klecknerreid.kleck...@gmail.com wrote: They should be able to use a slotted cmp_to_key style class:

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Neil Schemenauer
Greg Ewing greg.ew...@canterbury.ac.nz wrote: So am I. It seems to result from the hisorical mess of distinguishing between numeric and sequence operations at the C level but not the Python level. I think CPython should be moving in the direction of eliminating that distinction, not expecting

Re: [Python-Dev] Callable, non-descriptor class attributes.

2011-03-12 Thread Steven D'Aprano
Thomas Wouters wrote: I would much rather loudly warn people to fix their code, instead of forcing other implementations (and, more importantly to me personally, future CPython changes :) to deal with the distinction forever. But if we declare a wrapper to be the right way to deal with this,

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Steven D'Aprano
Fredrik Johansson wrote: Consider sorting a list of pairs representing fractions. This can be done easily in Python 2.x with the comparison function lambda (p,q),(r,s): cmp(p*s, q*r). In Python 2.6, this is about 40 times faster than using fractions.Fraction as a key function. [steve@sylar

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Glenn Linderman
On 3/12/2011 2:09 PM, Terry Reedy wrote: I believe that if the integer field were padded with leading blanks as needed so that all are the same length, then no key would be needed. Did you mean that if the integer field were converted to string and padded with leading blanks...? Otherwise

[Python-Dev] another message to release

2011-03-12 Thread R. David Murray
I believe the tracker sent an error message to python-dev as a result of a failed hook execution. If someone with the power would release that message so we can see what the error was, I'd appreciate it :) --David ___ Python-Dev mailing list

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Terry Reedy
On 3/12/2011 8:28 PM, Steven D'Aprano wrote: Fredrik Johansson wrote: Consider sorting a list of pairs representing fractions. This can be done easily in Python 2.x with the comparison function lambda (p,q),(r,s): cmp(p*s, q*r). In Python 2.6, this is about 40 times faster than using

Re: [Python-Dev] About raising NotPortableWarning for CPython specific code

2011-03-12 Thread Terry Reedy
On 3/12/2011 8:23 PM, Neil Schemenauer wrote: Greg Ewinggreg.ew...@canterbury.ac.nz wrote: So am I. It seems to result from the hisorical mess of distinguishing between numeric and sequence operations at the C level but not the Python level. I think CPython should be moving in the direction of

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Martin v. Löwis
[steve@sylar ~]$ python2.7 -m timeit -s L = [(1,2), (3,4), (0,5), (9,100), (3,7), (2,8)] sorted(L, lambda (p,q),(r,s): cmp(p*s, q*r)) 1 loops, best of 3: 25.1 usec per loop [steve@sylar ~]$ python2.7 -m timeit -s L = [(1,2), (3,4), (0,5), (9,100), (3,7), (2,8)] -s from fractions import

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Raymond Hettinger
On Mar 12, 2011, at 3:44 PM, Guido van Rossum wrote: I was just reminded that in Python 3, list.sort() and sorted() no longer support the cmp (comparator) function argument. The reason is that the key function argument is always better. But now I have a nagging doubt about this: I

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Terry Reedy
On 3/12/2011 8:47 PM, Glenn Linderman wrote: On 3/12/2011 2:09 PM, Terry Reedy wrote: I believe that if the integer field were padded with leading blanks as needed so that all are the same length, then no key would be needed. Did you mean that if the integer field were converted to string and

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread skip
Martin I don't think any of the regular core committers got any such Martin explicit veto powers on any code... Veto powers is your term, not mine. I suggested that Raymond's opinion should be accorded extra weight. This isn't the UN Security Council. Skip

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread Martin v. Löwis
Am 12.03.11 22:36, schrieb s...@pobox.com: Martin I don't think any of the regular core committers got any such Martin explicit veto powers on any code... Veto powers is your term, not mine. I suggested that Raymond's opinion should be accorded extra weight. This isn't the UN

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Glenn Linderman
On 3/12/2011 7:21 PM, Terry Reedy wrote: (Ok, I assumed that the 'word' field does not include any of !#$%'()*+. If that is not true, replace comma with space or even a control char such as '\a' which even precedes \t and \n.) OK, I agree the above was your worst assumption, although you need

Re: [Python-Dev] Suggest reverting today's checkin (recursive constant folding in the peephole optimizer)

2011-03-12 Thread skip
Martin == Martin v Löwis mar...@v.loewis.de writes: Martin Am 12.03.11 22:36, schrieb s...@pobox.com: Martin I don't think any of the regular core committers got any such Martin explicit veto powers on any code... Veto powers is your term, not mine. I suggested that

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Terry Reedy
On 3/12/2011 10:52 PM, Glenn Linderman wrote: On 3/12/2011 7:21 PM, Terry Reedy wrote: The safest such character is \0,\ Works fine in Python. unless you are coding in C, Then \01 is next best. I wouldn't have called you on this, except that it really is important not to give people