Re: [Python-Dev] Can LOAD_GLOBAL be optimized to a simple array lookup?

2006-08-24 Thread K.S.Sreeram
Alex Martelli wrote: > > On Aug 23, 2006, at 2:22 PM, K.S.Sreeram wrote: > >> Hi all, >> >> I noticed in Python/ceval.c that LOAD_GLOBAL uses a dictionary lookup, >> and was wondering if that can be optimized to a simple array lookup. >> >> If i'm right there are 3 kinds of name lookups: locals,

Re: [Python-Dev] PEP 362 open issues

2006-08-24 Thread Nick Coghlan
Brett Cannon wrote: > Another question: could it be helpful to make Parameter.default_value a > weak reference? > > > Perhaps, but I don't think it is necessarily required. I can change it > if others want to go that way, but for now I am happy with the way it is. Leave it as a normal

Re: [Python-Dev] Can LOAD_GLOBAL be optimized to a simple arraylookup?

2006-08-24 Thread martin
Zitat von "K.S.Sreeram" <[EMAIL PROTECTED]>: > How about this approach: > (disclaimer: this is just a rough sketch!) This is actually the problem. There are many fine details which can affect performance and correctness. So about there are only two sensible ideas to treat such ideas: either imple

[Python-Dev] xrange accepting non-ints

2006-08-24 Thread Neal Norwitz
I've been working on enhancing xrange and there are a bunch of issues to consider. I've got pretty much complete implementations in both C and Python. Currently xrange is 2 objects: range and the iter. These only work on C longs. Here's what I propose: 2.6: * Add deprecation warning if a floa

Re: [Python-Dev] xrange accepting non-ints

2006-08-24 Thread Guido van Rossum
On 8/24/06, Neal Norwitz <[EMAIL PROTECTED]> wrote: > I've been working on enhancing xrange and there are a bunch of issues > to consider. I've got pretty much complete implementations in both C > and Python. Currently xrange is 2 objects: range and the iter. > These only work on C longs. Here'

Re: [Python-Dev] xrange accepting non-ints

2006-08-24 Thread Thomas Wouters
On 8/24/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 8/24/06, Neal Norwitz <[EMAIL PROTECTED]> wrote:> I've been working on enhancing xrange and there are a bunch of issues> to consider.  I've got pretty much complete implementations in both C > and Python.  Currently xrange is 2 objects:  ra

Re: [Python-Dev] xrange accepting non-ints

2006-08-24 Thread Fredrik Lundh
Neal Norwitz wrote: > I've profiled various combinations. Here are the various results > normalized doing xrange(0, 1e6, 1): > > Run on all integer (32-bit) values for start, step, end: > C xrange and iter: 1 > Py xrange w/C iter: 1 in real life, loops are a lot shorter than that. if you take

Re: [Python-Dev] Can LOAD_GLOBAL be optimized to a simple array lookup?

2006-08-24 Thread Tim Peters
Note that there are already three PEPs related to speeding dict-based namespace access; start with: http://www.python.org/dev/peps/pep-0280/ which references the other two. The "normal path" through dict lookups got faster since there was a rash of those, to the extent that more complication

Re: [Python-Dev] Can LOAD_GLOBAL be optimized to a simple array lookup?

2006-08-24 Thread K.S.Sreeram
Tim Peters wrote: > Note that there are already three PEPs related to speeding dict-based > namespace access; start with: > > http://www.python.org/dev/peps/pep-0280/ > > which references the other two. > > The "normal path" through dict lookups got faster since there was a > rash of those,

[Python-Dev] for 2.5 issues

2006-08-24 Thread Neal Norwitz
I don't want to make any more changes to 2.5 unless we absolutely have to. I also don't want to lose fixes. How about for anything that should be resolved in 2.5, but wait for 2.5.1 we set the tracker item to: Group 2.5, Resolution: Later, Priority 7. Then it should be easy to find these things

[Python-Dev] draft for bug guidelines

2006-08-24 Thread Brett Cannon
Below is the current draft of a set of bug guidelines for people to follow when they want to file a bug.  The hope is that when we get an email asking "how do I file a bug?" we can point them towards these sets of guidelines for most issues. Let me know about any errors and such.  This will (hopefu

[Python-Dev] draft of patch guidelines

2006-08-24 Thread Brett Cannon
Below is a draft for a set of patch guidelines.  This is meant for that times where people ask "how do a create a patch for a change I made" or where to point people if they created a patch but it comes up short (no tests, etc.).  Hopefully this will go up on python.org/dev/ .Let me know of any er

[Python-Dev] Need help with test_mutants.py

2006-08-24 Thread Guido van Rossum
There's a unit test "test_mutants" which I don't understand. If anyone remembers what it's doing, please contact me -- after ripping out dictionary ordering in Py3k, it stops working. In particular, the code in test_one() requires changes, but I don't know how... Please help! -- --Guido van Rossu

Re: [Python-Dev] draft for bug guidelines

2006-08-24 Thread Oleg Broytmann
On Thu, Aug 24, 2006 at 12:21:06PM -0700, Brett Cannon wrote: > Start a new bug "Before starting a new bug please try to search if the bug has already been reported. It it has - do not start a new report, add your comments to the existing report." Oleg. -- Oleg Broytmannhttp:

Re: [Python-Dev] draft of patch guidelines

2006-08-24 Thread Oleg Broytmann
On Thu, Aug 24, 2006 at 12:22:42PM -0700, Brett Cannon wrote: > Read the Developer Intro to understand the scope of your proposed change "Search through the PEPs, developer mailing lists and patches. Has a similar patch already been proposed? Has it been accepted, postponed or rejected? Learn t

Re: [Python-Dev] Need help with test_mutants.py

2006-08-24 Thread Tim Peters
[Guido] > There's a unit test "test_mutants" which I don't understand. If anyone > remembers what it's doing, please contact me -- after ripping out > dictionary ordering in Py3k, Is any form of dictionary comparison still supported, and, if so, what does "dict1 cmp_op dict2" mean now? > it stops

Re: [Python-Dev] Need help with test_mutants.py

2006-08-24 Thread Guido van Rossum
On 8/24/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I made that change, and changed class Horrid to define __eq__ instead > of __cmp__. Since dict_equal() only invokes PyObject_RichCompareBool() > with op==Py_EQ that should be all that's needed. > > Now when I run it, it spits out an apaprent

Re: [Python-Dev] draft for bug guidelines

2006-08-24 Thread Brett Cannon
Made it the first step.  =)-BrettOn 8/24/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote: On Thu, Aug 24, 2006 at 12:21:06PM -0700, Brett Cannon wrote:> Start a new bug   "Before starting a new bug please try to search if the bug has alreadybeen reported. It it has - do not start a new report, add you

Re: [Python-Dev] draft of patch guidelines

2006-08-24 Thread Brett Cannon
On 8/24/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote: On Thu, Aug 24, 2006 at 12:22:42PM -0700, Brett Cannon wrote:> Read the Developer Intro to understand the scope of your proposed change   "Search through the PEPs, developer mailing lists and patches. Has a similar patch already been proposed? H

Re: [Python-Dev] Need help with test_mutants.py

2006-08-24 Thread Guido van Rossum
On 8/24/06, Tim Peters <[EMAIL PROTECTED]> wrote: > [Guido] > > There's a unit test "test_mutants" which I don't understand. If anyone > > remembers what it's doing, please contact me -- after ripping out > > dictionary ordering in Py3k, > > Is any form of dictionary comparison still supported, and

Re: [Python-Dev] Need help with test_mutants.py

2006-08-24 Thread Guido van Rossum
On 8/24/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Should I attempt to reproduce this bug in 2.5 and fix it? Couldn't help myself. The fix is python.org/sf/1546288 . I set the priority to 8 which means Neal and Anthony will look at it. It's probably okay to reduce the priority to 7 and fix

[Python-Dev] zip -> izip; is __length_hint__ required?

2006-08-24 Thread Guido van Rossum
At today's sprint, Brian Holmes contributed a patch that implements zip as an interator, a la izip. When reviewing Brian's code, I noticed that he added an implementation of __length_hint__. My gut feeling is that this isn't particularly useful given that zip() is almost exclusively used iterativel

Re: [Python-Dev] draft of patch guidelines

2006-08-24 Thread Chad Whitacre
Brett, > Below is a draft for a set of patch guidelines. Thanks for getting around to this! > Wait for a developer to contact you > === > > At this point you need to wait for a Python developer to come along > and look at your patch. This might be a while

Re: [Python-Dev] draft of patch guidelines

2006-08-24 Thread Brett Cannon
On 8/24/06, Chad Whitacre <[EMAIL PROTECTED]> wrote: Brett, > Below is a draft for a set of patch guidelines.Thanks for getting around to this!Welcome. > Wait for a developer to contact you > === > > At this point you need to wait for a Python developer to come alo