[issue8692] Use divide-and-conquer for faster factorials

2010-05-11 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Tue, May 11, 2010 at 7:42 PM, Daniel Stutzbach rep...@bugs.python.org wrote: .. Isn't that adding an extra check in every case to speed up a you-can't-seriously-expect-that-to-work corner case? The check is cheap -

[issue8692] Use divide-and-conquer for faster factorials

2010-05-11 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: On Tue, May 11, 2010 at 7:15 PM, Alexander Belopolsky rep...@bugs.python.org wrote: The main value in setting a theoretically justified limit is that overflow exception can carry a meaningful message, e.g. factorial result

[issue8692] Use divide-and-conquer for faster factorials

2010-05-11 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: On Tue, May 11, 2010 at 7:38 PM, Alexander Belopolsky rep...@bugs.python.org wrote: Speaking of micro-optimizations, did you consider a better than naive algorithm for Count the number of set bits in n in your patch? HAKMEM

[issue8692] Use divide-and-conquer for faster factorials

2010-05-11 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Tue, May 11, 2010 at 9:07 PM, Daniel Stutzbach rep...@bugs.python.org wrote: Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: On Tue, May 11, 2010 at 7:38 PM, Alexander Belopolsky

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Muhammad Bashir Al-Noimi
New submission from Muhammad Bashir Al-Noimi mbno...@gmx.com: After installing python-3.1.2.msi I'm not able to run to python.exe at all because it gives me the following error message: Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding:

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Muhammad Bashir Al-Noimi
Muhammad Bashir Al-Noimi mbno...@gmx.com added the comment: I uninstalled python-2.6.3 before installing python-3.1.2.msi -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8693 ___

[issue8692] Use divide-and-conquer for faster factorials

2010-05-11 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Tue, May 11, 2010 at 10:19 PM, Alexander Belopolsky rep...@bugs.python.org wrote: .. Similarly, while unlikely to improve performance, I would prefer not to use any bit-trick implementation of ilog2 (in a separate

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: This is a duplicate of issue1616979. -- nosy: +loewis resolution: - duplicate status: open - closed superseder: - cp720 encoding map ___ Python tracker rep...@bugs.python.org

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Muhammad Bashir Al-Noimi
Muhammad Bashir Al-Noimi mbno...@gmx.com added the comment: No No, this isn't duplicated issue because if I copied cp720.py to Python31\Lib\encodings Python still crashed and gives me the following error Fatal Python error: Py_Initialize: can't initialize sys standard streams TypeError:

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Muhammad Bashir Al-Noimi
Changes by Muhammad Bashir Al-Noimi mbno...@gmx.com: -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8693 ___ ___

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Muhammad Bashir Al-Noimi
Muhammad Bashir Al-Noimi mbno...@gmx.com added the comment: This is the file I'm adding for removing warning message which is not the reason of crashing -- Added file: http://bugs.python.org/file17303/cp720.py ___ Python tracker

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-11 Thread Muhammad Bashir Al-Noimi
Muhammad Bashir Al-Noimi mbno...@gmx.com added the comment: humm I re-read issue1616979 I'm confused is it really duplicate issue? if yes I couldn't find the way for fixing in issue1616979 PS I'm newbie in Python and I faced this problem in first day I use Python so please forgive me if my

[issue8678] crashers in rgbimg

2010-05-11 Thread Tomas Hoger
Tomas Hoger tho...@redhat.com added the comment: According to PEP-0004, affected module was deprecated in 2.5 and is no longer part of 2.6 and later. Hence 2.5 only, not sure if that version is still actively supported upstream. -- nosy: +thoger versions: -Python 2.6, Python 2.7

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: I've tested a variant of the previous patch. On my laptop, it gives good performance for simple cases, and the penalty for real-quoting case is very low. I've tested a short-circuit for the unquote() function too. -- nosy:

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: Removed file: http://bugs.python.org/file17290/issue1285086_fast_quote.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1285086 ___

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: Added file: http://bugs.python.org/file17291/issue1285086_fast_quote.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1285086 ___

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: Lets also see how this fares in py3k (where quote function takes an encoding ) and possibly push it in. If there is any hesitation we can consult python-dev or wsgi groups where frameworks developers might review and voice concerns, if

[issue8510] update to autoconf2.65

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Roumen: good catch! Indeed, nested functions aren't legal in standard C, and the test for -fno-strict-aliasing now fails on my OS X 10.6.3 machine, where it used to pass: checking whether gcc accepts -fno-strict-aliasing... no

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-11 Thread Andrew Bennetts
New submission from Andrew Bennetts s...@users.sourceforge.net: set.difference(s), when s is also a set, basically does:: res = set() for elem in self: if elem not in other: res.add(elem) This is wasteful when len(self) is much greater than len(other): $ python -m

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-11 Thread Andrew Bennetts
Andrew Bennetts s...@users.sourceforge.net added the comment: Oops, obvious bug in this patch. set('abc') - set('bcd') != set('bcd') - set('abc'). I'll see if I can make a more sensible improvement. See also http://bugs.python.org/issue8425. Thanks dickinsm on #python-dev. --

[issue8510] update to autoconf2.65

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Merged to py3k, and fixed up an additional nested 'int main()', in r81078. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8510 ___

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-11 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - rhettinger nosy: +rhettinger versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8685 ___

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

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: See also issue 8685. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8425 ___

[issue8510] update to autoconf2.65

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: BTW, it looks as though the nested functions were introduced in r76030; nothing to do with Matthias's autoconf 2.65 update. -- ___ Python tracker rep...@bugs.python.org

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-11 Thread Andrew Bennetts
Andrew Bennetts s...@users.sourceforge.net added the comment: Ok, this time test_set* passes :) Currently if you have large set and small set the code will do len(large) lookups in the small set. When large is than small, it is cheaper to copy large and do len(small) lookups in large. On

[issue8510] update to autoconf2.65

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Just double checked that r80969 didn't introduce any other non-whitespace changes: apart from the now-fixed OS X 10.5 SDK issue), the only other non-whitespace change was: @@ -7018,7 +7023,7 @@ int main () { -long double x; x = (long

[issue8510] update to autoconf2.65

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Closing. Roumen, please open a new issue for any other configure issues that aren't related to this autoconf update. -- resolution: - accepted stage: - committed/rejected status: open - closed

[issue8684] improvements to sched.py

2010-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This must be retargeted to 3.2. Also, the patch lacks some tests. It seems PEP 8 compliance could be better: function names shouldn't be CamelCased. Is LocalSynchronize() an implementation detail rather than a public API? If so, I think it would

[issue8686] This isn't defined beyond that phrase is not friendly to non-native English speakers.

2010-05-11 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/library/difflib.html#difflib.SequenceMatcher.quick_ratio This isn’t defined beyond that it is an upper bound on ratio(), and is faster to compute. beyond is a bit confusing because it also means over and this

[issue8684] improvements to sched.py

2010-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: By the way, the patch lacks docs for new public APIs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8684 ___

[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: There is a reason, and that is that it may break existing code in the field relying on the current behavior. This is (unfortunately) true regardless of whether the function is public or private, though the fact that it is ostensibly

[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Hmm. I didn't read your comment carefully enough before I replied. I think you are saying that the bug fix is confined to the routine in question and doesn't change even its API, in which case the nature of the function doesn't come

[issue8684] improvements to sched.py

2010-05-11 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: What are the enhancements introduced by this patch? A faster cancel() implementation? If so some simple benchmarks showing the speed improvement of cancel() and eventually also other methods like enterabs() and run() would be nice to have.

[issue8687] sched.py module doesn't have a test suite

2010-05-11 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' g.rod...@gmail.com: sched.py module is currently lacking a test suite. Possibly this should be resolved before fixing issue 8684. -- components: Tests messages: 105503 nosy: giampaolo.rodola, josiah.carlson, josiahcarlson, pitrou priority: normal

[issue8684] improvements to sched.py

2010-05-11 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Created issue 8687 to address the test suite problem. -- superseder: - sched.py module doesn't have a test suite ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8684

[issue8688] distutils sdist is too laze w.r.t. recalculating MANIFEST

2010-05-11 Thread Ronald Oussoren
New submission from Ronald Oussoren ronaldousso...@mac.com: The sdist command in distutils calculates the MANIFEST file from a template (by default MANIFEST.in). The code in sdist assumes that the contents of MANIFEST only depends on MANIFEST.in and setup.py, which can cause files to be

[issue8675] audioop module needs an int - Py_ssize_t upgrade

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a patch. -- keywords: +patch Added file: http://bugs.python.org/file17294/audioop_Py_ssize_t.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8675

[issue8686] This isn't defined beyond that phrase is not friendly to non-native English speakers.

2010-05-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Unfortunately that wouldn't be correct English, as far as I know. How about This isn't defined other than that... I think that reads a bit more clearly than beyond that even to a native speaker, even though beyond is valid in this

[issue8686] This isn't defined beyond that phrase is not friendly to non-native English speakers.

2010-05-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 3.1 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8686 ___ ___

[issue7897] Support parametrized tests in unittest

2010-05-11 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I agree with Michael - one test that covers multiple settings can easily be done by collecting results within the test itself and then checking at the end that no failures were detected (e.g. I've done this myself with a test that needed to

[issue8684] improvements to sched.py

2010-05-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- dependencies: +sched.py module doesn't have a test suite superseder: sched.py module doesn't have a test suite - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8684

[issue8674] audioop: incorrect integer overflow checks

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixed one more bogus overflow check in r81079 through r81082. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8674 ___

[issue1381] cmath is numerically unsound

2010-05-11 Thread Sebastien Binet
Sebastien Binet bi...@cern.ch added the comment: hi there, it seems there is still a problem, at least with asinh(-2j) see: $ python Python 2.6.5 (r265:79063, Apr 1 2010, 05:28:39) [GCC 4.4.3 20100316 (prerelease)] on linux2 Type help, copyright, credits or license for more information.

[issue8675] audioop module needs an int - Py_ssize_t upgrade

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The audioop module was made PY_SSIZE_T_CLEAN in r81083. -- components: +Extension Modules resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker

[issue1381] cmath is numerically unsound

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Python's result looks fine to me, as does numpy's: they're both giving a valid inverse hyperbolic sine: from cmath import sinh sinh(1.3169578969248166-1.5707963267948966j) (1.0605752387249067e-16-1.9998j)

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: New patch, using str.translate instead of regexp. It is faster for normal cases (85% less time than stdlib quote), and the penalty for the real-quoting case is less than 5%. It should apply to 3.x with some adaptation. --

[issue8687] sched.py module doesn't have a test suite

2010-05-11 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Patch in attachment. -- keywords: +patch Added file: http://bugs.python.org/file17296/test_sched.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8687

[issue1381] cmath is numerically unsound

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: A bit more explanation: Python takes account of the sign of zero when deciding which side of the branch cut a value lies, which is the proper thing to do when you have signed zeros available (according to the likes of Kahan, anyway); I

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: The speed test script did not work on 2.5 (because timeit.Timer does not accept a callable). Fixed version, which benchmarks the str.translate(...) version. Change the '_new_quote_setup' assignment to test other variants. --

[issue1381] cmath is numerically unsound

2010-05-11 Thread Sebastien Binet
Sebastien Binet bi...@cern.ch added the comment: hi Mark, that may very well be so, but I'd naively standardize on C/Fortran behaviour (but that's probably my physicist bias) on my platform, the following piece of C-code: $ cat test_cmath.c #include complex.h #include stdio.h int main(int

[issue1381] cmath is numerically unsound

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: that may very well be so, but I'd naively standardize on C/Fortran behaviour (but that's probably my physicist bias) Yep, that's exactly what Python does. :) (Also follows the LISP standard). Note that in your program, you're feeding

[issue7897] Support parametrized tests in unittest

2010-05-11 Thread Yaroslav Halchenko
Yaroslav Halchenko yarikop...@gmail.com added the comment: Hi Nick, Am I reading your right, Are you suggesting to implement this manual looping/collecting/reporting separately in every unittest which needs that? On Tue, 11 May 2010, Nick Coghlan wrote: Nick Coghlan ncogh...@gmail.com added

[issue1381] cmath is numerically unsound

2010-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Note that in your program, you're feeding complex(-0.0, -2.0) to asinh, not complex(0.0, 2.0). Bah; that should be complex(0.0, -2.0) in the second line, of course. Anyway, try passing conj(2*I) to asinh in your C program and see what

[issue1381] cmath is numerically unsound

2010-05-11 Thread Sebastien Binet
Sebastien Binet bi...@cern.ch added the comment: Note that in your program, you're feeding complex(-0.0, -2.0) to asinh, not complex(0.0, -2.0). ah! (ducking) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1381

[issue7978] SocketServer doesn't handle syscall interruption

2010-05-11 Thread Christophe Simonis
Changes by Christophe Simonis simonis.christo...@gmail.com: -- nosy: +Christophe Simonis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7978 ___

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: Removed file: http://bugs.python.org/file17297/urllib_quote_speed_test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1285086 ___

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: actually, there's a simpler implementation, using s.rstrip(always_safe + safe). It is as fast as the previous one. -- Added file: http://bugs.python.org/file17298/issue1285086_using_rstrip.diff

[issue8256] TypeError: bad argument type for built-in operation

2010-05-11 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8256 ___ ___

[issue1285086] urllib.quote is too slow

2010-05-11 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: Added file: http://bugs.python.org/file17299/urllib_quote_speed_test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1285086 ___

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-11 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8685 ___ ___

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-11 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I have two problems with this proposal: 1. In constrained memory environments, creating a temporary internal copy of a large set may cause the difference operation to fail that would otherwise succeed. 2. The break-even

[issue8689] sqlite3 parameter substitution breaks with multiple parameters

2010-05-11 Thread Simon Jagoe
New submission from Simon Jagoe azriph...@gmail.com: I have been using sqlalchemy and sqlamp in a project for a while with Python 2.5.x and Python 2.6.4. With a recent upgrade to Python 2.6.5 (on Ubuntu Lucid Lynx), a particular operation began to fail when using sqlite. I have tracked this

[issue1641] asyncore delayed calls feature

2010-05-11 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Let the user leverage the existing scheduler API. Cut out scheduled_task and call_later, which just wraps the scheduler API. The user can simply call scheduled_tasks.enter() or scheduled_tasks.cancel(). It's one less API for them

[issue1641] asyncore delayed calls feature

2010-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Adding a call: scheduler = sched.scheduler(time.time, time.sleep) scheduler.enter(10, 1, function, (arg,)) ...vs: asyncore.call_later(10, function, arg) I don't really see the difference. How hard it is to build a scheduler object at

[issue8683] HPUX Segmentation fault in Modules/gcmodule.c -- if (!gc_list_is_empty(from)) {

2010-05-11 Thread srid
srid sridh...@activestate.com added the comment: Still debugging it. In gcmodule.c:collect(..) the value of the variable `generation` is 80 - shouldn't it be less than NUM_GENERATIONS (3)? -- nosy: +ronaldoussoren ___ Python tracker

[issue8683] HPUX Segmentation fault in Modules/gcmodule.c -- if (!gc_list_is_empty(from)) {

2010-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Still debugging it. In gcmodule.c:collect(..) the value of the variable `generation` is 80 - shouldn't it be less than NUM_GENERATIONS (3)? Certainly. Have you tried using different optimization options? Which compiler are you using?

[issue1641] asyncore delayed calls feature

2010-05-11 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: On Tue, May 11, 2010 at 11:55 AM, Giampaolo Rodola' rep...@bugs.python.org wrote: Moreover, reset() and delay() methods are not implemented in sched. Other problems which comes to mind are: you can't easily know whether a

<    1   2   3