[Python-Dev] [issue8033] sqlite: broken long integer handling for arguments to user-defined functions

2011-01-04 Thread Phil Le Bienheureux
Hello, I am quite new to development in python, and as a first contribution to the community, I have provided a patch to the issue 8033 (quite trivial). I then ran the test suite an everything was ok. However, the status has not changed, and nobody has answered so far (patch provided one month ago

Re: [Python-Dev] [Python-checkins] devguide: Strip out all generic svn instructions from the FAQ. It's not only

2011-01-04 Thread Eli Bendersky
On Wed, Jan 5, 2011 at 04:13, Nick Coghlan wrote: > On Wed, Jan 5, 2011 at 5:55 AM, brett.cannon > wrote: > > brett.cannon pushed 72a286c3452d to devguide: > > > > http://hg.python.org/devguide/rev/72a286c3452d > > changeset: 13:72a286c3452d > > user:Brett Cannon > > date:Tue

Re: [Python-Dev] [Python-checkins] devguide: Strip out all generic svn instructions from the FAQ. It's not only

2011-01-04 Thread Nick Coghlan
On Wed, Jan 5, 2011 at 5:55 AM, brett.cannon wrote: > brett.cannon pushed 72a286c3452d to devguide: > > http://hg.python.org/devguide/rev/72a286c3452d > changeset:   13:72a286c3452d > user:        Brett Cannon > date:        Tue Jan 04 11:48:38 2011 -0800 > summary: >  Strip out all generic svn i

Re: [Python-Dev] Started my PSF core grant today

2011-01-04 Thread Raymond Hettinger
On Jan 4, 2011, at 4:36 PM, Brett Cannon wrote: > For those of you who don't know, the PSF has given me a two month > grant to work on the core. It's mostly focused on the long overdue > overhaul of the dev docs (now being called the devguide) and writing a > HOWTO on porting Python 2 code to Pyt

[Python-Dev] Started my PSF core grant today

2011-01-04 Thread Brett Cannon
For those of you who don't know, the PSF has given me a two month grant to work on the core. It's mostly focused on the long overdue overhaul of the dev docs (now being called the devguide) and writing a HOWTO on porting Python 2 code to Python 3. If I have time left over it will be spent on the te

[Python-Dev] Steroidal builtins (was: Possible optimization for LOAD_FAST ?)

2011-01-04 Thread skip
Steven> I've been known to monkey-patch builtins in the interactive Steven> interpreter and in test code. Me too. I use a slightly beefed up dir() funcion which identifies modules within a package which haven't been imported yet. Handy for quick-n-dirty introspection. >>> import em

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 3:36 PM, Michael Foord wrote: > The only examples I could find from a quick search (using the patch > decorator from my mock module which is reasonably well used) patch > __builtins__.open and raw_input. > > https://www.google.com/codesearch?hl=en&lr=&q=%22patch%28%27__built

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Michael Foord
On 04/01/2011 23:29, Guido van Rossum wrote: On Tue, Jan 4, 2011 at 3:13 PM, Steven D'Aprano wrote: Guido van Rossum wrote: But why couldn't you edit the source code? Because there was no source code -- I was experimenting in the interactive interpreter. I could have just re-created the funct

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Michael Foord
On 04/01/2011 23:29, Guido van Rossum wrote: On Tue, Jan 4, 2011 at 3:13 PM, Steven D'Aprano wrote: Guido van Rossum wrote: But why couldn't you edit the source code? Because there was no source code -- I was experimenting in the interactive interpreter. I could have just re-created the funct

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 2:13 PM, Lukas Lueg wrote: > I very much like the fact that python has *very* little black magic > revealed to the user. Strong -1 on optimizing picked builtins in a > picked way. That's easy for you to say. -- --Guido van Rossum (python.org/~guido) __

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 3:13 PM, Steven D'Aprano wrote: > Guido van Rossum wrote: >> But why couldn't you edit the source code? > > Because there was no source code -- I was experimenting in the interactive > interpreter. I could have just re-created the function by using the readline > history, bu

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Lukas Lueg
I very much like the fact that python has *very* little black magic revealed to the user. Strong -1 on optimizing picked builtins in a picked way. 2011/1/4 Steven D'Aprano : > Guido van Rossum wrote: >> >> On Tue, Jan 4, 2011 at 2:49 AM, Michael Foord >> wrote: >>> >>> I think someone else pointe

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Steven D'Aprano
Guido van Rossum wrote: On Tue, Jan 4, 2011 at 1:50 PM, Steven D'Aprano wrote: I've been known to monkey-patch builtins in the interactive interpreter and in test code. One example that comes to mind is that I had some over-complicated recursive while loop (!), and I wanted to work out the Big

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 2:15 PM, Daniel Stutzbach wrote: > On Tue, Jan 4, 2011 at 9:33 AM, Lukas Lueg > wrote: >> >> The keys are immutable anyway so the instances of PyDict could manage >> a opaque value (in fact, a counter) that changes every time a new >> value is written to any key. Once we ge

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Daniel Stutzbach
On Tue, Jan 4, 2011 at 9:33 AM, Lukas Lueg wrote: > The keys are immutable anyway so the instances of PyDict could manage > a opaque value (in fact, a counter) that changes every time a new > value is written to any key. Once we get a reference out of the dict, > we can can do very fast lookups by

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 1:50 PM, Steven D'Aprano wrote: > I've been known to monkey-patch builtins in the interactive interpreter and > in test code. One example that comes to mind is that I had some > over-complicated recursive while loop (!), and I wanted to work out the Big > Oh behaviour so I k

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Steven D'Aprano
Guido van Rossum wrote: On Tue, Jan 4, 2011 at 2:49 AM, Michael Foord wrote: I think someone else pointed this out, but replacing builtins externally to a module is actually common for testing. In particular replacing the open function, but also other builtins, is often done temporarily to repl

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 8:22 AM, Tres Seaver wrote: > Note that Guido just recently wrote on that list that he considers that > PEP to be de facto accepted. That was conditional on there not being any objections in the next 24 hours. There have been plenty, so I'm retracting that. -- --Guido van

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Neil Schemenauer
Barry Warsaw wrote: > On Jan 04, 2011, at 10:21 AM, Alex Gaynor wrote: > >>Ugh, I can't be the only one who finds these special cases to be a little >>nasty? >> >>Special cases aren't special enough to break the rules. > > Yeah, I agree. Still it would be interesting to see what kind of > perform

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Lukas Lueg
Doesnt this all boil down to being able to monitor PyDict for changes to it's key-space? The keys are immutable anyway so the instances of PyDict could manage a opaque value (in fact, a counter) that changes every time a new value is written to any key. Once we get a reference out of the dict, we

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Michael Foord
On 04/01/2011 16:54, Barry Warsaw wrote: On Jan 04, 2011, at 10:21 AM, Alex Gaynor wrote: Ugh, I can't be the only one who finds these special cases to be a little nasty? Special cases aren't special enough to break the rules. Yeah, I agree. Still it would be interesting to see what kind of

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Barry Warsaw
On Jan 04, 2011, at 10:21 AM, Alex Gaynor wrote: >Ugh, I can't be the only one who finds these special cases to be a little >nasty? > >Special cases aren't special enough to break the rules. Yeah, I agree. Still it would be interesting to see what kind of performance improvement this would resul

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Reid Kleckner
On Tue, Jan 4, 2011 at 8:21 AM, Alex Gaynor wrote: > Ugh, I can't be the only one who finds these special cases to be a little > nasty? > Special cases aren't special enough to break the rules. > Alex +1, I don't think nailing down a few builtins is that helpful for optimizing Python. Anyone att

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-04 Thread P.J. Eby
At 03:44 AM 1/4/2011 +0100, Victor Stinner wrote: Hi, In the PEP , I read: -- import os, sys enc, esc = sys.getfilesystemencoding(), 'surrogateescape' def wsgi_string(u): # Convert an environment variable to a WSGI "bytes-as-unicode" string return u.encode(enc, esc).dec

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/03/2011 09:44 PM, Victor Stinner wrote: > Hi, > > In the PEP , I read: > -- > import os, sys > > enc, esc = sys.getfilesystemencoding(), 'surrogateescape' > > def wsgi_string(u): > # Convert an environment variable to a WSG

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Alex Gaynor
On Tue, Jan 4, 2011 at 10:20 AM, Nick Coghlan wrote: > On Wed, Jan 5, 2011 at 1:58 AM, Guido van Rossum wrote: > > On Tue, Jan 4, 2011 at 2:49 AM, Michael Foord > wrote: > >> I think someone else pointed this out, but replacing builtins externally > to > >> a module is actually common for testi

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Nick Coghlan
On Wed, Jan 5, 2011 at 1:58 AM, Guido van Rossum wrote: > On Tue, Jan 4, 2011 at 2:49 AM, Michael Foord > wrote: >> I think someone else pointed this out, but replacing builtins externally to >> a module is actually common for testing. In particular replacing the open >> function, but also other

Re: [Python-Dev] Checking input range in time.asctime and time.ctime

2011-01-04 Thread Alexander Belopolsky
On Mon, Jan 3, 2011 at 7:47 PM, Guido van Rossum wrote: > Given the rule garbage in -> garbage out, I'd do the most useful > thing, which would be to produce a longer output string (and update > the docs). I did not know that GIGO was a design rule, but after thinking about it some more, I agree.

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Guido van Rossum
On Tue, Jan 4, 2011 at 2:49 AM, Michael Foord wrote: > I think someone else pointed this out, but replacing builtins externally to > a module is actually common for testing. In particular replacing the open > function, but also other builtins, is often done temporarily to replace it > with a mock.

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Nick Coghlan
On Tue, Jan 4, 2011 at 8:49 PM, Michael Foord wrote: > I think someone else pointed this out, but replacing builtins externally to > a module is actually common for testing. In particular replacing the open > function, but also other builtins, is often done temporarily to replace it > with a mock.

Re: [Python-Dev] Backport troubles with mercurial

2011-01-04 Thread Barry Warsaw
On Dec 30, 2010, at 02:50 AM, R. David Murray wrote: >You are welcome; thanks for the feedback. (I sometimes feel >like I'm working in a bit of a vacuum, though Barry does chime in >occasionally...but I do realize that people are busy; that's >why I inherited this job in the first place, after al

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-04 Thread Antoine Pitrou
On Tue, 04 Jan 2011 14:33:37 +0100 Victor Stinner wrote: > Le mardi 04 janvier 2011 à 13:20 +0100, Antoine Pitrou a écrit : > > On Tue, 04 Jan 2011 03:44:53 +0100 > > Victor Stinner wrote: > > > def wsgi_string(u): > > > # Convert an environment variable to a WSGI "bytes-as-unicode" > > > str

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-04 Thread Victor Stinner
Le mardi 04 janvier 2011 à 13:20 +0100, Antoine Pitrou a écrit : > On Tue, 04 Jan 2011 03:44:53 +0100 > Victor Stinner wrote: > > def wsgi_string(u): > > # Convert an environment variable to a WSGI "bytes-as-unicode" > > string > > return u.encode(enc, esc).decode('iso-8859-1') > > > > de

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-04 Thread Antoine Pitrou
On Tue, 04 Jan 2011 03:44:53 +0100 Victor Stinner wrote: > def wsgi_string(u): > # Convert an environment variable to a WSGI "bytes-as-unicode" > string > return u.encode(enc, esc).decode('iso-8859-1') > > def run_with_cgi(application): > environ = {k: wsgi_string(v) for k,v in os.env

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Michael Foord
On 04/01/2011 01:02, Guido van Rossum wrote: On Mon, Jan 3, 2011 at 9:52 AM, David Malcolm wrote: On Sun, 2011-01-02 at 19:18 -0800, Guido van Rossum wrote: On Sun, Jan 2, 2011 at 5:50 PM, Alex Gaynor wrote: No, it's singularly impossible to prove that any global load will be any given value