Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): - Issue #15906: Fix a regression in argparse caused by the preceding change,

2012-09-11 Thread Chris Jerdonek
On Tue, Sep 11, 2012 at 9:13 PM, barry.warsaw wrote: > http://hg.python.org/cpython/rev/25e41fdc4e60 > changeset: 79001:25e41fdc4e60 > parent: 78998:6fea947edead > parent: 79000:bc342cd7ed96 > user:Barry Warsaw > date:Wed Sep 12 00:12:29 2012 -0400 > summary: > - Iss

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Guido van Rossum
On Tue, Sep 11, 2012 at 5:40 PM, Victor Stinner wrote: > 2012/9/11 Guido van Rossum : >> FWIW, I expect that there are few places where len() >> is actually used. > > I found one revelant example in the stdlib. > > if path.endswith('.dylib'): > yield path[:-len('.dylib'

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
2012/9/11 Guido van Rossum : > FWIW, I expect that there are few places where len() > is actually used. I found one revelant example in the stdlib. if path.endswith('.dylib'): yield path[:-len('.dylib')] + suffix + '.dylib' else: yield path

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
> i am a longtime Reader of this list and this is the first time i a dare to > speak up. > Apology in advance for any noise, silly comments and not posting to > python-ideas ;). Welcome! > Well how about implementing guards like in pypy? Guards would allow to generate specialized functions witho

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 05:30 PM, Terry Reedy wrote: >> And yet, that's how it works in 2.7, 3.2, and 3.3.1. > >In all 2.7 or 3.2? It will be broken in 2.7.4 and 3.2.4, but the Ubuntu packages in 12.10 are currently affected because they pulled in some Mercurial updates which included these unrelease

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread larudwer
Hello, i am a longtime Reader of this list and this is the first time i a dare to speak up. Apology in advance for any noise, silly comments and not posting to python-ideas ;). Am 11.09.2012 12:41, schrieb Victor Stinner: I plan to implement other optimizations like unrolling loop or convert

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread MRAB
On 11/09/2012 22:46, Victor Stinner wrote: 2012/9/11 Nick Coghlan : This is fine in an external project, but should never be added to the standard library. The barrier to semantic changes that break monkeypatching should be high. The version 0.3 has a known bug: "len=chr; print(len('A'))" is o

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
>>> - frozenset("ab") | frozenset("bc") => frozenset("abc") > > That's a name lookup, too. Yes, and it is only optimized if the "builtin_funcs" feature is enabled explictly. > Except that evaluating something like '"abc" * constant' can eat up all > memory, imagine this code: > > KILL_MEMOR

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
>> * Call builtin functions if arguments are constants. Examples: >> >>- len("abc") => 3 >>- ord("A") => 65 > > Does this mean transformation print("A") => None and output at compile time? Only a subset of builtin functions are called at compile time, and not with any constant value. See a

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
2012/9/11 Nick Coghlan : > This is fine in an external project, but should never be added to the > standard library. The barrier to semantic changes that break > monkeypatching should be high. The version 0.3 has a known bug: "len=chr; print(len('A'))" is optimized, whereas it should not. It is no

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Terry Reedy
On 9/11/2012 3:31 PM, Barry Warsaw wrote: On Sep 11, 2012, at 01:17 PM, Terry Reedy wrote: As I see it, storing is done *with* a default or explicit value, appending is done *to* a start value *with* whatever. Perhaps reusing 'default' instead of using a new name such as 'start' was a bit too

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 10:13 PM, Georg Brandl wrote: >> Traceback (most recent call last): >> File "/home/barry/projects/python/3.3.0/Parser/asdl.py", line 309, in visit >> meth(object, *args) >> File "./Parser/asdl_c.py", line 1043, in visitSum >> self.simpleSum(sum, name) >> File "./P

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Georg Brandl
On 11.09.2012 21:25, Barry Warsaw wrote: > On Sep 11, 2012, at 03:08 PM, Barry Warsaw wrote: > >>Are you sure about that? >> >>% ./python >>Python 3.3.0rc2+ (default:6fea947edead, Sep 11 2012, 15:03:16) > > Never mind. Georg didn't pull that patch into his release clone. > > (Aside: Georg, may

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 12:19 PM, R. David Murray wrote: >There is another possible semantic, which is that when the store type is >append, the converter should be applied to each of the individual items in >the default list. Yep. Maybe for 3.4 . >Which brings us to another issue: as things stand n

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 10:39 AM, Chris Jerdonek wrote: >So another way out could simply be not to call type on non-strings. >Indeed, this was done before. One of the changes that was made in the >patch for issue 12776 was to remove the str type check prior to >calling type. Yep, so probably that's

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 01:17 PM, Terry Reedy wrote: >This second example strikes me (naively, as English speaker but not argparse >user) as 'wrong' in that 'default' is being misused to mean 'start value that >is always used to generate the final value' [as in sum(iterable, start=0)], >rather than 'f

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 03:08 PM, Barry Warsaw wrote: >Are you sure about that? > >% ./python >Python 3.3.0rc2+ (default:6fea947edead, Sep 11 2012, 15:03:16) Never mind. Georg didn't pull that patch into his release clone. (Aside: Georg, maybe you could fiddle with the default branch's version num

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread R. David Murray
On Tue, 11 Sep 2012 15:08:26 -0400, Barry Warsaw wrote: > On Sep 11, 2012, at 12:19 PM, R. David Murray wrote: > > >The 12776 fix isn't going to be in 3.3, so I don't think this is a > >pressing issue. We can take our time to make sure we have the correct > >fix. It is, however, a release block

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
On Sep 11, 2012, at 12:19 PM, R. David Murray wrote: >The 12776 fix isn't going to be in 3.3, so I don't think this is a >pressing issue. We can take our time to make sure we have the correct >fix. It is, however, a release blocker for 2.7.4, 3.2.4, and 3.3.1. Are you sure about that? % ./pyth

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Stefan Behnel
Serhiy Storchaka, 11.09.2012 20:48: > set([1, 2, 3]) => {1, 2, 3} > set([x for ...]) => {x for ...} > dict([(k, v) for ...]) => {k: v for ...} > dict((k, v) for ...) => {k: v for ...} > ''.join([s for ...]) => ''.join(s for ...) > a.extend([s for ...]) => a.extend(s for ...) > (f(x) for x in a) =>

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Stefan Behnel
Nick Coghlan, 11.09.2012 14:57: > On Tue, Sep 11, 2012 at 8:41 PM, Victor Stinner wrote: >> * Loop: replace range() with xrange() on Python 2, and list with >> tuple. Examples: >> >> - for x in range(n): ... => for x in xrange(n): ... >> - for x in [1, 2, 3]: ... => for x in (1, 2, 3): ... >

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Serhiy Storchaka
On 11.09.12 13:41, Victor Stinner wrote: Here are some progress on my astoptimizer project. If you are interested by the optimizer, run it on your own project or help me to implement more optimizations. http://pypi.python.org/pypi/astoptimizer https://bitbucket.org/haypo/astoptimizer It's a ve

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Chris Jerdonek
On Tue, Sep 11, 2012 at 10:17 AM, Terry Reedy wrote: > On 9/11/2012 11:34 AM, Barry Warsaw wrote: >> It seems to me that the semantics could reasonably be implied to mean that >> the >> type converter should only be applied to the default value when >> action='store', as is the default. Then in t

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Guido van Rossum
On Tue, Sep 11, 2012 at 10:06 AM, MRAB wrote: > On 11/09/2012 13:06, Victor Stinner wrote: * Call builtin functions if arguments are constants. Examples: - len("abc") => 3 - ord("A") => 65 >>> >>> >>> Does it preserve python semantics? What if you change the len builti

Re: [Python-Dev] [RELEASED] Python 3.3.0 release candidate 2

2012-09-11 Thread Georg Brandl
Indeed, thanks for catching that. The GPG signatures are good, so the downloads are the original ones built by Martin. Georg On 11.09.2012 18:11, Perica Zivkovic wrote: > Just a small note, MD5 for RC2 file python-3.3.0rc2.msi is not correct on > http://python.org/download/releases/3.3.0/ > >

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Terry Reedy
On 9/11/2012 11:34 AM, Barry Warsaw wrote: Issue 15906 describes a problem with argparse that is breaking lots of code in Ubuntu. This is a recent regression caused by the fix for issue 12776, and it affects Python 2.7, 3.2, and 3.3. I posted a diff that should fix the problem, but at the heart

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread MRAB
On 11/09/2012 13:06, Victor Stinner wrote: * Call builtin functions if arguments are constants. Examples: - len("abc") => 3 - ord("A") => 65 Does it preserve python semantics? What if you change the len builtin? This optimization is disabled by default (in the version 0.3), because built

Re: [Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread R. David Murray
On Tue, 11 Sep 2012 11:34:30 -0400, Barry Warsaw wrote: > Issue 15906 describes a problem with argparse that is breaking lots of code in > Ubuntu. This is a recent regression caused by the fix for issue 12776, and it > affects Python 2.7, 3.2, and 3.3. > > I posted a diff that should fix the pro

Re: [Python-Dev] [RELEASED] Python 3.3.0 release candidate 2

2012-09-11 Thread Perica Zivkovic
Just a small note, MD5 for RC2 file python-3.3.0rc2.msi is not correct on http://python.org/download/releases/3.3.0/ it would be nice if someone can update it cheers, Perica On Sunday, September 9, 2012 4:25:39 AM UTC-5, Georg Brandl wrote: > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1

[Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

2012-09-11 Thread Barry Warsaw
Issue 15906 describes a problem with argparse that is breaking lots of code in Ubuntu. This is a recent regression caused by the fix for issue 12776, and it affects Python 2.7, 3.2, and 3.3. I posted a diff that should fix the problem, but at the heart of it is a semantic ambiguity in argparse th

Re: [Python-Dev] Snakebite v0.1: ready for beta testing.

2012-09-11 Thread Trent Nelson
On Tue, Sep 11, 2012 at 06:16:52AM -0700, Nick Coghlan wrote: > On Tue, Sep 11, 2012 at 10:28 PM, Trent Nelson wrote: > > (Pro-tip though: `sh snakebite.subr` will always do its best to > > re-initialize everything, like fixing permissions when svn update > > strips them, etc.) > > Th

Re: [Python-Dev] Snakebite v0.1: ready for beta testing.

2012-09-11 Thread Nick Coghlan
On Tue, Sep 11, 2012 at 10:28 PM, Trent Nelson wrote: > (Pro-tip though: `sh snakebite.subr` will always do its best to > re-initialize everything, like fixing permissions when svn update > strips them, etc.) That's actually causing some problems - if SELinux security context info or

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Nick Coghlan
On Tue, Sep 11, 2012 at 8:41 PM, Victor Stinner wrote: > * Call builtin functions if arguments are constants. Examples: > > - len("abc") => 3 > - ord("A") => 65 This is fine in an external project, but should never be added to the standard library. The barrier to semantic changes that break m

Re: [Python-Dev] Snakebite v0.1: ready for beta testing.

2012-09-11 Thread Trent Nelson
On Tue, Sep 11, 2012 at 05:23:34AM -0700, Brett Cannon wrote: >Very cool, Trent! I also love the retro use of svn as a tie-in to how long >you have been fighting to bring this project to fruition. =) Haha. I probably shouldn't mention that I started writing all the wrapper .snakeb

Re: [Python-Dev] Snakebite v0.1: ready for beta testing.

2012-09-11 Thread Trent Nelson
On Tue, Sep 11, 2012 at 05:20:01AM -0700, Trent Nelson wrote: > Quick start: > > % cd ~ && svn co http://svn.snakebite.net/.snakebite && cd .snakebite && sh > snakebite.subr For those that already have ~/.snakebite, one of these will work: - sbctl hard-reset, or - svn upd

Re: [Python-Dev] Snakebite v0.1: ready for beta testing.

2012-09-11 Thread Brett Cannon
Very cool, Trent! I also love the retro use of svn as a tie-in to how long you have been fighting to bring this project to fruition. =) On Tue, Sep 11, 2012 at 8:20 AM, Trent Nelson wrote: > Quick start: > > % cd ~ && svn co http://svn.snakebite.net/.snakebite && cd .snakebite && > sh snakeb

[Python-Dev] Snakebite v0.1: ready for beta testing.

2012-09-11 Thread Trent Nelson
Quick start: % cd ~ && svn co http://svn.snakebite.net/.snakebite && cd .snakebite && sh snakebite.subr If all goes well, you should see something like this: A.snakebite/snakebite.subr A.snakebite/ssh_config_ext A.snakebite/ssh_known_hosts U .snakebite Checked out revisio

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
>> * Call builtin functions if arguments are constants. Examples: >> >> - len("abc") => 3 >> - ord("A") => 65 > > Does it preserve python semantics? What if you change the len builtin? This optimization is disabled by default (in the version 0.3), because builtin functions may be shadowed. Exa

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Maciej Fijalkowski
On Tue, Sep 11, 2012 at 12:41 PM, Victor Stinner wrote: > Hi, > > Here are some progress on my astoptimizer project. If you are interested by > the optimizer, run it on your own project or help me to implement more > optimizations. > > http://pypi.python.org/pypi/astoptimizer > https://bitbucket.o

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Christian Heimes
Am 11.09.2012 12:41, schrieb Victor Stinner: > Hi, > > Here are some progress on my astoptimizer project. If you are interested by > the optimizer, run it on your own project or help me to implement more > optimizations. Wow, that's an amazing list of optimizations. Keep up the good work! Christ

[Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread Victor Stinner
Hi, Here are some progress on my astoptimizer project. If you are interested by the optimizer, run it on your own project or help me to implement more optimizations. http://pypi.python.org/pypi/astoptimizer https://bitbucket.org/haypo/astoptimizer --- The last version (0.3) works on Python 2.6-

[Python-Dev] issues found by Coverity

2012-09-11 Thread Christian Heimes
Hello, maybe you have noticed a bunch of commits I made the last couple of days. They were all related to resource leaks and other issues that were detected by Coverity. Maybe you have seen the CID in some checkin messages. Most memory and reference leaks were found in the error branch of functio