[Python-Dev] accept string in a2b and base64?

2012-02-21 Thread Stephen J. Turnbull
R. David Murray writes: > If most people agree with Antoine I won't fight it, but it seems to me > that accepting unicode in the binascii and base64 APIs is a bad > idea. First, I agree with David that this change should have been brought up on python-dev before committing it. The distinction

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 3:20 PM, wrote: >> I'm with Antoine here - being able to force a particular seed still >> matters for testing purposes. However, the documentation of the option >> may need to be updated for 3.3 to emphasise that it should only be >> used to reproduce sporadic failures. Us

Re: [Python-Dev] CPU vs Wall time Profiling

2012-02-21 Thread Sümer Cip
> > The original reason was that the Unix wall clock was more accurate > than its CPU clock. If that's changed we should probably (perhaps in a > platform-dependent way) change the default to the most accurate clock > available. > > Currently it seems clock_gettime() APIs have nanosecond resolution

Re: [Python-Dev] Windows build - fixing compile warnings before VS2010

2012-02-21 Thread martin
Zitat von Brian Curtin : While some effort has gone on to get the 32-bit build to compile without warnings (thanks for that!), 64-bit still has numerous warnings. Before I push forward on more of the VS2010 port, I'd like to have a clean 2008 build all around so we can more easily track what ma

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread martin
Thanks for describing the use case. By the way, when working with ET I also wanted to track the memory usage of the package a couple of times, which made me lament that there's no useful memory profiler in the stdlib. A memory profiler can be a ten-line Python function which, however, does need

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread martin
I'm with Antoine here - being able to force a particular seed still matters for testing purposes. However, the documentation of the option may need to be updated for 3.3 to emphasise that it should only be used to reproduce sporadic failures. Using it to work around applications that can't cope wi

[Python-Dev] Windows build - fixing compile warnings before VS2010

2012-02-21 Thread Brian Curtin
While some effort has gone on to get the 32-bit build to compile without warnings (thanks for that!), 64-bit still has numerous warnings. Before I push forward on more of the VS2010 port, I'd like to have a clean 2008 build all around so we can more easily track what may have changed. In completing

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Eli Bendersky
> > I can't fathom why someone would do it though, since bar tiny > > differences (like this one) cET is just a faster ET and it's available > > practically everywhere with CPython. I mean, is it really important to > > be able to subclass ET.Element? What goal does it serve? > > Statements like th

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Eli Bendersky
> I'm happy to stand up as an example of someone who uses a custom Element > class. My specific use case is loading the project Gutenberg database, > which is a 210MB XML file. I created a custom Element class which I use > for the top-level element (a custom element_factory passed to > TreeBuild

Re: [Python-Dev] CPU vs Wall time Profiling

2012-02-21 Thread Guido van Rossum
On Tue, Feb 21, 2012 at 1:00 PM, Sümer Cip wrote: > Is there a reason behind the fact that the Python profilers work with Wall > time by default? There are OS-dependent ways to get the CPU time of a > thread, and giving that choice to the user _somehow_ ( to use wall vs cpu > time) might be a good

Re: [Python-Dev] Status of PEP 397 - Python launcher for Windows

2012-02-21 Thread Mark Hammond
On 22/02/2012 2:50 AM, Vinay Sajip wrote: Mark Hammond gmail.com> writes: think there is something that could be added to those docs - the use of PATHEXT and the fact that once the shebang line is in place, a command-prompt could do just "hello.py" rather than needing "py hello.py". Or even

Re: [Python-Dev] [Python-checkins] cpython: enable hash randomization by default

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 7:08 AM, benjamin.peterson wrote: > +      Changing hash values affects the order in which keys are retrieved > from a > +      dict.  Although Python has never made guarantees about this ordering > (and > +      it typically varies between 32-bit and 64-bit builds), enou

Re: [Python-Dev] [Python-checkins] cpython (2.6): ensure no one tries to hash things before the random seed is found

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 8:49 AM, Nick Coghlan wrote: > Won't this trigger in the -Wd case that led to the PyStr_Fini workaround? Never mind, just saw the later series of checkins that fixed it. Cheers, Nick. -- Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia ___

Re: [Python-Dev] [Python-checkins] cpython (2.6): ensure no one tries to hash things before the random seed is found

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 2:24 AM, benjamin.peterson wrote: > http://hg.python.org/cpython/rev/357e268e7c5f > changeset:   75133:357e268e7c5f > branch:      2.6 > parent:      75124:04738f35e0ec > user:        Benjamin Peterson > date:        Tue Feb 21 11:08:50 2012 -0500 > summary: >  ensure no o

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 8:16 AM, Andrew McNabb wrote: > So, I would be one of those people who would flood in the complaints. :) As another "you don't know what you're going to break" war story: In Python 2.5, using "-m" with a package appeared to work, but actually slightly corrupted the import

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 8:07 AM, Antoine Pitrou wrote: > On Tue, 21 Feb 2012 22:51:48 +0100 > "Martin v. Löwis" wrote: >> On the contrary. PYTHONHASHSEED should go in 3.3, as should any >> facility to disable or otherwise fix the seed. > > Being able to reproduce exact output is useful to chase s

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Andrew McNabb
On Tue, Feb 21, 2012 at 10:47:43PM +0100, "Martin v. Löwis" wrote: > > I can't fathom why someone would do it though, since bar tiny > > differences (like this one) cET is just a faster ET and it's available > > practically everywhere with CPython. I mean, is it really important to > > be able to s

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 7:47 AM, "Martin v. Löwis" wrote: > Am 21.02.2012 11:41, schrieb Eli Bendersky: >> I can't fathom why someone would do it though, since bar tiny >> differences (like this one) cET is just a faster ET and it's available >> practically everywhere with CPython. I mean, is it r

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Antoine Pitrou
On Tue, 21 Feb 2012 22:51:48 +0100 "Martin v. Löwis" wrote: > Am 21.02.2012 20:59, schrieb Antoine Pitrou: > > On Tue, 21 Feb 2012 14:58:41 -0500 > > Benjamin Peterson wrote: > >> 2012/2/21 Antoine Pitrou : > >>> > >>> Hello, > >>> > >>> Shouldn't it be enabled by default in 3.3? > >> > >> Should

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Antoine Pitrou
On Tue, 21 Feb 2012 12:41:17 +0200 Eli Bendersky wrote: > On Tue, Feb 21, 2012 at 03:59, Nick Coghlan wrote: > > > On Tue, Feb 21, 2012 at 11:39 AM, Eli Bendersky wrote: > > > So the two choices here are either change the documentation or the C > > > implementation to actually make Element a cl

Re: [Python-Dev] CPU vs Wall time Profiling

2012-02-21 Thread Victor Stinner
Python 3.3 has two new functions in the time module: monotonic() and wallclock(). Victor ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Martin v. Löwis
Am 21.02.2012 11:41, schrieb Eli Bendersky: > > > On Tue, Feb 21, 2012 at 03:59, Nick Coghlan > wrote: > > On Tue, Feb 21, 2012 at 11:39 AM, Eli Bendersky > wrote: > > So the two choices here are either change the documentation or

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Martin v. Löwis
>> Should you be able to disable it? > > No, but you should be able to provide a seed. Why exactly is that? We should take an attitude that Python hash values are completely arbitrary and can change at any point without notice. The only strict requirement should be that hashing must be consisten

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Martin v. Löwis
Am 21.02.2012 20:59, schrieb Antoine Pitrou: > On Tue, 21 Feb 2012 14:58:41 -0500 > Benjamin Peterson wrote: >> 2012/2/21 Antoine Pitrou : >>> >>> Hello, >>> >>> Shouldn't it be enabled by default in 3.3? >> >> Should you be able to disable it? > > PYTHONHASHSEED=0 should disable it. Do we also

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Barry Warsaw
On Feb 21, 2012, at 09:58 PM, Xavier Morel wrote: >On 2012-02-21, at 21:24 , Brett Cannon wrote: >> On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: >> >>> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: >>> 2012/2/21 Antoine Pitrou : > > Hello, > > Shouldn't it

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Brett Cannon
On Tue, Feb 21, 2012 at 15:58, Xavier Morel wrote: > On 2012-02-21, at 21:24 , Brett Cannon wrote: > > On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: > > > >> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: > >> > >>> 2012/2/21 Antoine Pitrou : > > Hello, > > Shoul

Re: [Python-Dev] CPU vs Wall time Profiling

2012-02-21 Thread Maciej Fijalkowski
On Tue, Feb 21, 2012 at 2:00 PM, Sümer Cip wrote: > Hi all, > > Is there a reason behind the fact that the Python profilers work with Wall > time by default? There are OS-dependent ways to get the CPU time of a > thread, and giving that choice to the user _somehow_ ( to use wall vs cpu > time) mig

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Xavier Morel
On 2012-02-21, at 21:24 , Brett Cannon wrote: > On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: > >> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: >> >>> 2012/2/21 Antoine Pitrou : Hello, Shouldn't it be enabled by default in 3.3? >> >> Yes. >> >>> Should you

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Benjamin Peterson
2012/2/21 Antoine Pitrou : > > Hello, > > Shouldn't it be enabled by default in 3.3? I've now enabled it by default in 3.3. -- Regards, Benjamin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsu

[Python-Dev] CPU vs Wall time Profiling

2012-02-21 Thread Sümer Cip
Hi all, Is there a reason behind the fact that the Python profilers work with Wall time by default? There are OS-dependent ways to get the CPU time of a thread, and giving that choice to the user _somehow_ ( to use wall vs cpu time) might be a good feature? -- Sumer Cip __

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Brett Cannon
On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: > On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: > > >2012/2/21 Antoine Pitrou : > >> > >> Hello, > >> > >> Shouldn't it be enabled by default in 3.3? > > Yes. > > >Should you be able to disable it? > > No, but you should be able to provi

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Glenn Linderman
On 2/21/2012 11:58 AM, Benjamin Peterson wrote: 2012/2/21 Antoine Pitrou: Hello, Shouldn't it be enabled by default in 3.3? Should you be able to disable it? Yes, absolutely. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Barry Warsaw
On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: >2012/2/21 Antoine Pitrou : >> >> Hello, >> >> Shouldn't it be enabled by default in 3.3? Yes. >Should you be able to disable it? No, but you should be able to provide a seed. -Barry ___ Python-D

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Benjamin Peterson
2012/2/21 Antoine Pitrou : > On Tue, 21 Feb 2012 14:58:41 -0500 > Benjamin Peterson wrote: >> 2012/2/21 Antoine Pitrou : >> > >> > Hello, >> > >> > Shouldn't it be enabled by default in 3.3? >> >> Should you be able to disable it? > > PYTHONHASHSEED=0 should disable it.  Do we also need a command-

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Antoine Pitrou
On Tue, 21 Feb 2012 14:58:41 -0500 Benjamin Peterson wrote: > 2012/2/21 Antoine Pitrou : > > > > Hello, > > > > Shouldn't it be enabled by default in 3.3? > > Should you be able to disable it? PYTHONHASHSEED=0 should disable it. Do we also need a command-line option? Regards Antoine.

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Benjamin Peterson
2012/2/21 Antoine Pitrou : > > Hello, > > Shouldn't it be enabled by default in 3.3? Should you be able to disable it? -- Regards, Benjamin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscrib

Re: [Python-Dev] A panel with Guido/python-dev on scientific uses and Python 3 at Google HQ, March 2nd

2012-02-21 Thread Fernando Perez
On Tue, 21 Feb 2012 07:44:41 +, Fernando Perez wrote: > I wanted to point out to you folks, and invite any of you who could make > it in person, to a panel discussion we'll be having on Friday March 2nd, > at 3pm, during the PyData workshop that will take place at Google's > headquarters in Mo

[Python-Dev] What do you want me to discuss at PyCon's keynote?

2012-02-21 Thread Guido van Rossum
I'm starting to think about my annual PyCon keynote. I don't want it to be just a feel-good motivational speech (I'm no good at those), nor a dry "state of the Python union" talk (I'm bored with those), but I'd like to hear what Python users care about. I've created a Google+ post for feedback: ht

[Python-Dev] hash randomization in 3.3

2012-02-21 Thread Antoine Pitrou
Hello, Shouldn't it be enabled by default in 3.3? It's currently disabled. $ ./python -c "print(hash('aa'))" 12416074593111936 [44297 refs] $ ./python -c "print(hash('aa'))" 12416074593111936 [44297 refs] Thanks Antoine. ___ Python-Dev mailing list

Re: [Python-Dev] Status of PEP 397 - Python launcher for Windows

2012-02-21 Thread Vinay Sajip
Mark Hammond gmail.com> writes: > think there is something that could be added to those docs - the use of > PATHEXT and the fact that once the shebang line is in place, a > command-prompt could do just "hello.py" rather than needing "py hello.py". Or even just "hello" should work. Regards, V

Re: [Python-Dev] accept string in a2b and base64?

2012-02-21 Thread Nick Coghlan
On Tue, Feb 21, 2012 at 10:28 PM, Antoine Pitrou wrote: > So it's like typing `open(b"LICENSE", "r")`: the fast that `b"LICENSE"` > is bytes while `"r"` is str isn't really a problem. Ah, right - I misunderstood how the different arguments were being used. Cheers, Nick. -- Nick Coghlan   |   n

Re: [Python-Dev] accept string in a2b and base64?

2012-02-21 Thread Antoine Pitrou
On Tue, 21 Feb 2012 12:51:08 +1000 Nick Coghlan wrote: > > My one concern with the base64 patch is that it doesn't test that > mixing types triggers TypeError. While this shouldn't require any > extra code (the error should arise naturally from the method > implementation), it should still be tes

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-21 Thread Eli Bendersky
On Tue, Feb 21, 2012 at 03:59, Nick Coghlan wrote: > On Tue, Feb 21, 2012 at 11:39 AM, Eli Bendersky wrote: > > So the two choices here are either change the documentation or the C > > implementation to actually make Element a class. The first is of course > > simpler. However, someone somewhere

Re: [Python-Dev] PEP czar for PEP 3144?

2012-02-21 Thread Robert Kern
On 2/21/12 4:52 AM, Guido van Rossum wrote: On Mon, Feb 20, 2012 at 4:53 PM, Stephen J. Turnbull wrote: Steven D'Aprano writes: > Also, "Czar" is commonly used in US politics as an informal term for the top > official responsible for an area. I think here the most important connotation

Re: [Python-Dev] accept string in a2b and base64?

2012-02-21 Thread M.-A. Lemburg
Nick Coghlan wrote: > The reason Python 2's implicit str<->unicode conversions are so > problematic isn't just because they're implicit: it's because they > effectively assume *latin-1* as the encoding on the 8-bit str side. The implicit conversion in Python2 only works with ASCII content, pretty