[issue1941] 2.6 stdlib using with statement

2009-02-17 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone exar...@divmod.com: -- nosy: -exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1941 ___ ___ Python-bugs-list

[issue1941] 2.6 stdlib using with statement

2009-02-16 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1941 ___

[issue1941] 2.6 stdlib using with statement

2008-02-03 Thread Benjamin Peterson
Benjamin Peterson added the comment: I could break this patch into per-module patches. Then as authors approved them, they could gradually be committed. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941 __

[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: Comments? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Thomas Heller
Thomas Heller added the comment: Lib/platform.py contains this notice at the top: #This module is maintained by Marc-Andre Lemburg [EMAIL PROTECTED]. #If you find problems, please submit bug reports/patches via the #Python SourceForge Project Page and assign them to lemburg. # #

[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Please remove the platform.py part of the patch. You can apply that to Py3k, but not to the 2.x series. -- nosy: +lemburg __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941

[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: This new patch removes changes to the platform module. Added file: http://bugs.python.org/file9342/stdlib-with-stmt2-no-platform.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941

[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am unassigning because I don't have time for a detailed review. For the most part, I'm not excited about this patch which targets modules that aren't being actively supervised by their original contributor. -- assignee: rhettinger -

[issue1941] 2.6 stdlib using with statement

2008-01-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: Today, I carefully looked through every change in my patching. I asked myself Does this do the same things in the same order as the original? and Could exceptions cause the code to function differently? They only changes were when the block which used the

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Benjamin Peterson
New submission from Benjamin Peterson: This patch modernizes many modules in the stdlib by making them using the with statement. They affected modules are modulefinder, ftplib, cookielib, shutil, pydoc, platform, _LWPCookieJar, mailbox, _MozillaCookieJar, and zipfile. -- components:

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Thomas Heller
Thomas Heller added the comment: modulefinder should be kept compatible with Python 2.2, so please do not apply the patch for this module. See also PEP 291. No idea about the other modules. -- nosy: +theller __ Tracker [EMAIL PROTECTED]

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Christian Heimes
Christian Heimes added the comment: A while ago Raymond explained on Python developer list that the with statement is slightly slower than a try/finally block. Performance critical sections like the threading module must not use the with statement. -- assignee: - rhettinger keywords:

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: The patch doesn't change the threading module, so I'm not sure if there's anything in particular you think is performance critical there. The places where it uses try/finally are: * _Condition.wait. This performs operations on a mutex which are much

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Adam Olsen
Adam Olsen added the comment: Is there a guarantee that the with-statement is safe in the face of KeyboardInterrupt? PEP 343 seems to imply it's not, using it as a reason for why we need no special handling if __exit__ fails. -- nosy: +Rhamphoryncus __

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: It's explicitly not (and Guido said this is what he wanted, several times). However, CPython will not raise a KeyboardInterrupt in the middle of a C function. Hence my parenthetical about implementing the lock type in C.

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: This new patch removes the modulefinder changes. I was the one you submitted #1910 which probably sparked the performance debate. In this patch, I tried to avoid these touchy places. Added file: http://bugs.python.org/file9295/stdlib-with-stmt2.diff

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Adam Olsen
Adam Olsen added the comment: Yes, but there's no guarantee it will even reach the C function. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941 __ ___ Python-bugs-list

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: There may not be a guarantee, but it will with the current implementation, and the discussion on this ticket seems to be very geared towards CPython implementation peculiarities. __ Tracker [EMAIL PROTECTED]

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please make darned sure these changes are semantically neutral. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941 __ ___ Python-bugs-list

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: Sorry, but what does that mean? All tests are passing with the changes. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1941 __ ___

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Christian Heimes
Christian Heimes added the comment: Benjamin Peterson wrote: Sorry, but what does that mean? All tests are passing with the changes. Tests aren't a proof for correctness. A failing test proofs either an error in the implementation or in the test suite. The reverse all tests are passing =

[issue1941] 2.6 stdlib using with statement

2008-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: It means to that the test suites are likely inadequate in this department and that you need to carefully check each transformation to make sure it doesn't do something subtlely different. __ Tracker [EMAIL PROTECTED]