[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù
Michele Orrù added the comment: > I'm not sure of the usefulness of this comment. removing, then. > "else" redundant here. > Instead of using a local variable "intersected", you can simply add "else > Py_INCREF(other)" here and then decref "other" unconditionally. It will be > shorter and perha

[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù
Michele Orrù added the comment: > I'm not sure of the usefulness of this comment. removing, then. > "else" redundant here. > Instead of using a local variable "intersected", you can simply add "else > Py_INCREF(other)" here and then decref "other" unconditionally. It will be > shorter and perha

[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù
Changes by Michele Orrù : Removed file: http://bugs.python.org/file27293/bench.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file27306/bench.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue16035] Segmentation fault in test suite of apsw

2012-09-25 Thread Stefan Krah
Stefan Krah added the comment: [Adding the apsw author to the cc.] Antoine is right, no Python bug here. I think we can close this. -- nosy: +rogerbinns stage: -> committed/rejected status: pending -> closed ___ Python tracker

[issue16048] Tutorial-classes-remarks: replace paragragh

2012-09-25 Thread Terry J. Reedy
New submission from Terry J. Reedy: (from python-list thread "data attributes override method attributes?") "9.4. Random Remarks Data attributes override method attributes with the same name; to avoid accidental name conflicts, which may cause hard-to-find bugs in large programs, it is wise t

[issue16048] Tutorial-classes-remarks: replace paragragh

2012-09-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Peter Otten thought the first clause should instead be ""Data attributes and method attributes share the same namespace.", which is also true for a given object. This is a different intepretation of what the original author was getting at. The convention remar

[issue16048] Tutorial-classes-remarks: replace paragragh

2012-09-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ian Kelly reminds me that instance.__xxx__ is only skipped by the internal machinery and not by direct accesses in user code. In the other hand, docs, official or otherwise, are filled with things like 'len(a) calls a.__len__', so I think something should be s

[issue16010] Some Unicode in identifiers improperly rejected

2012-09-25 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> invalid ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue16036] simplify int() signature docs

2012-09-25 Thread Chris Jerdonek
Chris Jerdonek added the comment: I'm attaching an updated patch that does not cover certain edge cases that may differ for other Python implementations (and in fact does differ for PyPY). See issue 16045 for more information. -- Added file: http://bugs.python.org/file27307/issue-16036

[issue16023] IDLE freezes on ^5 or ^6 (Un-)Tabify Region with OS X Cocoa Tk 8.5

2012-09-25 Thread Ned Deily
Ned Deily added the comment: Thanks for the additional information! I can now reproduce a hang using just Ctrl-5 on a US keyboard input method. Ctrl-5 is the default IDLE keyboard accelerator for the "Tabify Region" menu item under the "Format" menu cascade for an edit window. With any curr

[issue16001] small ints: cache string representation

2012-09-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Small int caching saves both time and space. On a nearly fresh IDLE session: >>> sys.getrefcount(0) 772 >>> sys.getrefcount(1) 854 >>> sum(sys.getrefcount(i) for i in range(-5, 257)) 4878 While an interesting idea, I do not see the same gain here, and agree with

[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please don't apply this until I've signed-off on it. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-09-25 Thread Raymond Hettinger
New submission from Raymond Hettinger: Since inheritance is more commonplace and more easily understood than __metaclass__, the abc module would benefit from a simple helper class: class ABC(metaclass=ABCMeta): pass >From a user's point-of-view, writing an abstract base call become

[issue7427] BadStatusLine is hell to debug

2012-09-25 Thread Andrew Swan
Andrew Swan added the comment: I just got tripped up by this change, I wanted to catch the specific case of an http server closing a connection and assumed that the following would work: try: resp = conn.getresponse() except httplib.BadStatusLine, e: if len(e.line) == 0: # server closed

[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-25 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-09-25 Thread Jeremy Kloth
Changes by Jeremy Kloth : -- nosy: +jkloth ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue16050] ctypes: callback from C++ to Python fails with Illegal Instruction call

2012-09-25 Thread Pavel Maltsev
New submission from Pavel Maltsev: ppc_405, Linux 2.4, GCC 3.3.1 Python crashes on attempt to pass python callback function to custom C++ library under PowerPC 405. This happens because some versions of GCC (I guess below 4.1) doesn't raise __NO_FPRS__ flag if hard-floats is not supported, in

[issue7897] Support parametrized tests in unittest

2012-09-25 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue16047] Tools/freeze no longer works in Python 3

2012-09-25 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16051] Documentation missing pipes.quote()

2012-09-25 Thread Barry Morrison
New submission from Barry Morrison: Documentation here: http://docs.python.org/library/pipes.html makes no mention of quote() But the link to Source code: Lib/pipes.py http://hg.python.org/cpython/file/2.7/Lib/pipes.py has: 267 def quote(file): 268 """Return a shell-escaped version of the fi

[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-09-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- keywords: +easy type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue15805] Add stdout redirection tool to contextlib

2012-09-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: I like Nick's proposed variant and think it should go in contextlib, not the mocking library. Redirection has a lot of use cases that has nothing to do with mocking-up test suites. Contextlib is about general purpose context-managers that apply in many si

[issue16040] nntplib: unlimited readline() from connection

2012-09-25 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue15222] mailbox.mbox writes without empty line after each message

2012-09-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset a87ab9b0c9e5 by Petri Lehtinen in branch '2.7': #15222: Fix a test failure on Windows http://hg.python.org/cpython/rev/a87ab9b0c9e5 -- ___ Python tracker _

[issue15805] Add stdout redirection tool to contextlib

2012-09-25 Thread Nick Coghlan
Nick Coghlan added the comment: I'd actually be inclined to make it the full trio: redirect_stdin, redirect_stdout, redirect_stderr. Mostly because I don't see an especially compelling reason to privilege redirecting stdout over the other two standard streams, and the "pass in the stream name

<    1   2