[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-14 Thread James William Pye
James William Pye added the comment: Just downloaded v2 and tried it out against Python 2.7a0 (trunk:70381M, Mar 14 2009, 23:12:51). output of the "nested_issue.py" script with patch: j...@torch[]:org/python/trunk 0% /src/build/py/bin/python ./nested_issue.py () [try_with_nested] Skipping stat

[issue1714448] if something as x:

2009-03-14 Thread Jervis Whitley
Jervis Whitley added the comment: > Matthew suggested ~= instead of -> or "as". Try the patch, you can make changes (for those that aren't aware) by changing the token in Grammar/Grammar to whatever you wish. It is easy to do and you need only recompile after this step. example: assexp:

[issue5491] Clarify contextlib.nested semantics

2009-03-14 Thread Nick Coghlan
New submission from Nick Coghlan : Current doc example: with nested(A, B, C) as (X, Y, Z): do_something() with A as X: with B as Y: with C as Z: do_something() Recommended docs change: with nested(A(), B(), C()) as (X, Y, Z): do_something() m1, m2, m3 = A(), B

[issue1714448] if something as x:

2009-03-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Matthew suggested ~= instead of -> or "as". I dislike this because ~= first makes me think of "approximately equal to", and then it makes me think of augmented assignment, and only then do I remember that although ~ is used in Python for bitwise-not, ~= is

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: Note that the semantics in the current patch aren't quite correct, since the __exit__ attribute is retrieved inside the scope of the outer try/except block. Updated patch with the correct semantics coming soon. -- ___

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: Second draft attached, this time with tests and sans segmentation faults :) Limitations of this version of the patch: - still includes some unrelated marshal.c changes (improved error messages) - no documentation changes yet -- Added file: http://bugs.py

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: Removed first draft of patch - it was fundamentally flawed (it didn't clean up the stack properly when the statement body was skipped) -- ___ Python tracker _

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-14 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file13330/pep377_v1.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue1714448] if something as x:

2009-03-14 Thread Matthew Barnett
Matthew Barnett added the comment: At the moment binding occurs either right-to-left with "=", eg. x = y where "x" is the new name, or left-to-right, eg. import x as y where "y" is the new name. If the order is to be right-to-left then using "as" seems to be the best choice. On the

[issue1714448] if something as x:

2009-03-14 Thread Jervis Whitley
Jervis Whitley added the comment: > Regarding the proposed syntax: > if (f() == 'spam') -> name: > newname = name.replace('p', 'h') > Surely that should assign the *bool* result of comparing f() > with 'spam' to name? Doing anything else is opening the door to a > world of pain. You are

[issue2116] weakref copy module interaction

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch so that copied weakdicts are decoupled (adding an item to the copy doesn't mutate the original). -- Added file: http://bugs.python.org/file13335/issue2116-2.patch ___ Python tracker

[issue1714448] if something as x:

2009-03-14 Thread Jervis Whitley
Jervis Whitley added the comment: > If we allow this, how many of the following will be allowed? > if expr as name: > while expr as name: > expr as name # alternative to "name = expr" This patch implements your final point: expr as name (albeit with a nominal '->' RARROW rather than 'as')

[issue1714448] if something as x:

2009-03-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Regarding the proposed syntax: if (f() == 'spam') -> name: newname = name.replace('p', 'h') Surely that should assign the *bool* result of comparing f() with 'spam' to name? Doing anything else is opening the door to a world of pain. if (f() == 'spam')

[issue2116] weakref copy module interaction

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch providing proper copy and deepcopy support, including for weak dicts (the Proxy type is unsupported, though). -- Added file: http://bugs.python.org/file13334/issue2116.patch ___ Python tracker

[issue1714448] if something as x:

2009-03-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: What's wrong with this? ob = map[x][y].overpay if ob: ob.blit(x, y) Is this proposal just about saving one line? If we allow this, how many of the following will be allowed? if expr as name: while expr as name: expr as name # alternative to "name = e

[issue2116] weakref copy module interaction

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, forget that question. If we deepcopy the weakref target, it will be destroyed just afterwards, making the deepcopied weakref useless. -- ___ Python tracker ___

[issue2116] weakref copy module interaction

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Should a deepcopy of a weakref return the same weakref, or a weakref to a new copied object? Also, what about the optional callback? -- nosy: +pitrou ___ Python tracker ___

[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-14 Thread Eric Smith
Eric Smith added the comment: I implemented this one: field_name::= (identifier | integer | ) ("." attribute_name | "[" element_index "]")* Which I would have written as: field_name::= (identifier | integer)? ("." attribute_name | "[" element_index "]")* Not that it matters,

[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: Either Brandl or Peterson can and typically will change the .rst source if given the exact new text. For me to write that, I need to know the grammar you actually implemented. Did you, in essence, simply change field_name::= (identifier | integer) ("

[issue1700507] Carbon.Scrap.PutScrapFlavor

2009-03-14 Thread Garrett Cooper
Changes by Garrett Cooper : -- versions: -Python 2.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue1700507] Carbon.Scrap.PutScrapFlavor

2009-03-14 Thread Garrett Cooper
Changes by Garrett Cooper : -- versions: +Python 2.4, Python 2.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue1700507] Carbon.Scrap.PutScrapFlavor

2009-03-14 Thread Garrett Cooper
Garrett Cooper added the comment: The failure testcase that dingus9 provided is: import Carbon.Scrap as Scrap scrap = Scrap.GetCurrentScrap() scrap.GetScrapFlavorData('TEXT') -- ___ Python tracker _

[issue1700507] Carbon.Scrap.PutScrapFlavor

2009-03-14 Thread Garrett Cooper
Garrett Cooper added the comment: I'm confirming this issue on Intel / Leopard with python 2.5 (system python), 2.5 (macports) and 2.6 (macports). PPC / Tiger with python 2.3 (system python), 2.5 (macports) and 2.6 (macports) just errors out with: MacOS.Error: (-4960, 'coreFoundationUnknownErr

[issue5490] Broken DLL

2009-03-14 Thread Martin v. Löwis
Martin v. Löwis added the comment: issue 5489, I mean. -- superseder: Broken DLL -> Broken DLL ___ Python tracker ___ ___ Python-bugs-

[issue5490] Broken DLL

2009-03-14 Thread Martin v. Löwis
Martin v. Löwis added the comment: This is a duplicate of issue 5490. -- nosy: +loewis resolution: -> duplicate status: open -> closed superseder: -> Broken DLL ___ Python tracker

[issue5490] Broken DLL

2009-03-14 Thread JCoder
New submission from JCoder : When I try to install Python 2.6 on Windows ME, I get an error message saying that a DLL file needed to install it cannot be opened. By the way, I just posted this message, and apparantly, it disappeared. -- components: Installation messages: 83599 nosy: JC

[issue5489] Broken DLL

2009-03-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: The support for Win9x,Me,NT4 was dropped from python2.6. See http://www.python.org/dev/peps/pep-0011/ -- nosy: +ocean-city resolution: -> wont fix status: open -> closed ___ Python tracker

[issue2874] Remove use of the stat module in the stdlib

2009-03-14 Thread Brett Cannon
Brett Cannon added the comment: We never came to an agreement on how to handle this so it's just been sitting here. -- ___ Python tracker ___

[issue5489] Broken DLL

2009-03-14 Thread JCoder
New submission from JCoder : The windows installer for Python 2.6 failed to install Python on Windows ME because a DLL required for installation could not be run. -- components: Installation messages: 83596 nosy: JCoder severity: normal status: open title: Broken DLL type: behavior vers

[issue5488] nb_inplace_divide slot is missing in docs

2009-03-14 Thread Lorenz Quack
New submission from Lorenz Quack : http://docs.python.org/c-api/typeobj.html#PyNumberMethods lists the slots in the PyNumberMethods struct used to implement the Number Protocol for extension types. The entry for "binaryfunc nb_inplace_divide;" is missing from this listing. It belongs between "bi

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a benchmark ripped from the Computer Language Shootout (http://shootout.alioth.debian.org). Running "binary_trees.py 18" takes the following time: -> without patch: 330s. -> with patch:201s. (40% speedup) -> with GC disabled : 165s. Running

[issue5482] RFC: improve distutils bdist_rpm so it builds pure python modules as single packages that works across architectures

2009-03-14 Thread Rudd-O
Rudd-O added the comment: Apropos this bug, the issues are fleshed out here: http://rudd-o.com/new-projects/python-improvements/how-to-slash-man-years-from-the-process-of-building-rpms-out-of-python-modules -- ___ Python tracker

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a new patch against trunk. -- Added file: http://bugs.python.org/file13331/containeropts.patch ___ Python tracker ___ __

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12397/tuple+dictopts-alt.patch ___ Python tracker ___ ___ Python-bugs-list

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12396/tupleopts-alt.patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12389/dictopts2.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12387/tupleopts.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue1143] Update to latest ElementTree in Python 2.7

2009-03-14 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2009/3/14 Antoine Pitrou : > > Antoine Pitrou added the comment: > > I was silently suggesting that you could add it to the release PEP :-) Wow, I'm really not getting the subtle hints today. -- ___ Python track

[issue1143] Update to latest ElementTree in Python 2.7

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I was silently suggesting that you could add it to the release PEP :-) -- ___ Python tracker ___ ___

[issue1143] Update to latest ElementTree in Python 2.7

2009-03-14 Thread Benjamin Peterson
Benjamin Peterson added the comment: Well, sure, but I'm not going to do it. :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: First draft of patch attached. Limitations of this version of the patch: - includes some unrelated marshal.c changes (improved error messages) - no tests of the new functionality - contextlib not changed yet - no documentation changes The new semantics are in pl

[issue1714448] if something as x:

2009-03-14 Thread Jervis Whitley
Jervis Whitley added the comment: Hi, I like this idea. I've put together a short patch that will implement inline assignment. if f() -> name: use(name) or more powerfully: if f() -> name == 'spam': usespam(name) the old syntax if something as x: is still available if that is what

[issue4228] struct.pack('L', -1)

2009-03-14 Thread Mark Dickinson
Mark Dickinson added the comment: Was zipfile ever fixed to avoid this deprecated behaviour? If not, is the fix fairly trivial? It would be nice to be able to finally turn these struct deprecation warnings into errors in Python 3.1 and/or Python 2.7. -- nosy: +marketdickinson _

[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-14 Thread Eric Smith
Eric Smith added the comment: Committed: r70364 (trunk) r70366 (py3k) The docs still need updating. If anyone with more knowledge of the documentation system than I have would like to tackle those, please feel free! -- priority: -> high resolution: -> accepted __

[issue1568] PATCH: Armin's attribute lookup caching for 3.0

2009-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, reopening and retargetting to 3.1 in case someone wants to work on it. -- resolution: fixed -> accepted stage: -> patch review status: closed -> open type: feature request -> performance versions: +Python 3.1 -Python 3.0 __

[issue5463] Compiler warning get_ulong is never used 3.x

2009-03-14 Thread Mark Dickinson
Mark Dickinson added the comment: The latest patch looks good to me, and results in a much cleaner looking _struct.c. Thank you! One worry: the issue 4228 discussion suggests that the zipfile module still relies on the deprecated wrapping. I think this needs to be investigated (and fixed i

[issue4281] Idle - incorrectly displaying a character (Latin capital letter sharp s)

2009-03-14 Thread Vlastimil Brom
Vlastimil Brom added the comment: I just wanted to confirm, that there isn't a bug in idle nor tk, but somwhere in my istalled fonts. Now while testing python 3.1a1, when I also have a font containing ẞ LATIN CAPITAL LETTER SHARP S (DejaVu), it's more clear. Printing this character using a def

[issue1568] PATCH: Armin's attribute lookup caching for 3.0

2009-03-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I'm not sure this should be closed. According to Neil (see above) the implementation could be simpler in 3.0 -- ___ Python tracker ___ __

[issue5482] RFC: improve distutils bdist_rpm so it builds pure python modules as single packages that works across architectures

2009-03-14 Thread Rudd-O
Rudd-O added the comment: FYI: In RPM, the correct dependency to require a particulr python minor version is: python(abi) = 2.X where X is the minor version. -- ___ Python tracker

[issue5482] RFC: improve distutils bdist_rpm so it builds pure python modules as single packages that works across architectures

2009-03-14 Thread Rudd-O
Rudd-O added the comment: last comment, first line, I should amend it to say that even in 64bit arches, the /usr/lib (NOT ilb64) sitepackages dir is available. I would have to actually try this on the packages that I have, see how i fare. -- ___ Pyt

[issue5482] RFC: improve distutils bdist_rpm so it builds pure python modules as single packages that works across architectures

2009-03-14 Thread Rudd-O
Rudd-O added the comment: apparently, /usr/lib/python2.4/site-packages IS in the sys.path, which would seem to indicate that python would actually load pure python modules from there. Which means that the only fixes that need to go within distutils would be: 1. a fix so in 64bit arches, pure p

[issue5482] RFC: improve distutils bdist_rpm so it builds pure python modules as single packages that works across architectures

2009-03-14 Thread Rudd-O
Rudd-O added the comment: More info: >From my wicked noarch RPM compiled in an i386 machine, installed into my 64 bit centos (same OS): [rud...@tobey ~]$ python Python 2.4.5 (#1, Mar 13 2009, 12:13:36) [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2 Type "help", "copyright", "credits" or "li

[issue5479] Add an easy way to provide total ordering now that __cmp__ is deprecated/gone

2009-03-14 Thread Mart Sõmermaa
Mart Sõmermaa added the comment: > This is the 2.6 version. What about the 3.0 version in > http://docs.python.org/3.0/reference/datamodel.html#object.__lt__ > needs to be updated? When functools.total_ordering (whether it lands in functools is open) lands that section should be amended in the

[issue5487] Parts of Tkinter missing (but not when running from IDLE)

2009-03-14 Thread Martin v. Löwis
Martin v. Löwis added the comment: Why do you think this is a bug? You need to import tkinter.messagebox explicitly for your program to be correct. That you could do without inside IDLE is only because IDLE had already imported that module. Closing as "won't fix". -- nosy: +loewis reso

[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-14 Thread Eric Smith
Changes by Eric Smith : Removed file: http://bugs.python.org/file13283/half-baked-not-for-real-use.patch ___ Python tracker ___ ___ Python-bugs