Re: [Python-Dev] Python 3000: Special type for object attributes map keys

2008-04-07 Thread Guido van Rossum
Without an implementation and supporting profile data nobody is going to believe that you can do name lookup faster than with the built-in dict type in CPython. Note that names seen by the parser are already interned, so most of what you seem to be proposing is already implemented... On Wed, Mar

Re: [Python-Dev] Python 3000: Special type for object attributes map keys

2008-03-19 Thread Neil Toronto
Greg Ewing wrote: Neal Norwitz wrote: Part of this is done, but very differently in that all strings used in code objects are interned (stored in a dictionary And since two interned strings can be compared by pointer identity, I don't see how this differs significantly from the unique

Re: [Python-Dev] Python 3000: Special type for object attributes map keys

2008-03-19 Thread Tristan Seligmann
* Neal Norwitz [EMAIL PROTECTED] [2008-03-18 18:54:47 -0500]: First, you should measure the current speed difference. Something like: $ ./python.exe -m timeit -s 'd = {1: None}' 'd[1]' 100 loops, best of 3: 0.793 usec per loop $ ./python.exe -m timeit -s 'd = {1: None}' 'd[1]' 100

[Python-Dev] Python 3000: Special type for object attributes map keys

2008-03-18 Thread Henrik Vendelbo
It appears to me that if you can make mapping mechanisms faster in Python you can make significant overall speed improvements. I also think the proposed concept could add flexibility to persistence formats and RMI interfaces. My basic idea is to have a constant string type with an interpreter

Re: [Python-Dev] Python 3000: Special type for object attributes map keys

2008-03-18 Thread Neal Norwitz
On Wed, Mar 5, 2008 at 4:27 PM, Henrik Vendelbo [EMAIL PROTECTED] wrote: It appears to me that if you can make mapping mechanisms faster in Python you can make significant overall speed improvements. I also think the proposed concept could add flexibility to persistence formats and RMI

Re: [Python-Dev] Python 3000: Special type for object attributes map keys

2008-03-18 Thread Greg Ewing
Neal Norwitz wrote: Part of this is done, but very differently in that all strings used in code objects are interned (stored in a dictionary And since two interned strings can be compared by pointer identity, I don't see how this differs significantly from the unique integer idea. If the