[issue2138] Add a factorial function

2008-06-08 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Added math.factorial() in r64050. -- resolution: -> accepted status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3042] Add PEP 8 compliant aliases to threading module

2008-06-08 Thread Nick Coghlan
Nick Coghlan <[EMAIL PROTECTED]> added the comment: I'd still be inclined to put a @wraps(meth) decorator on the definition of the wrapper function (and then override to the supplied name afterwards) - remember that functools.wraps is a decorator factory rather than a decorator itself. That wou

[issue3065] Fix pickling bug of collections.namedtuple

2008-06-08 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Fixed in r64047. Thanks for the submission. -- assignee: georg.brandl -> rhettinger resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue3064] new turtle module for Python 3.0

2008-06-08 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- assignee: -> loewis ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-lis

[issue2618] Tile module: Add support for themed widgets

2008-06-08 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- resolution: -> duplicate status: open -> closed superseder: -> Ttk support for Tkinter ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3065] Fix pickling bug of collections.namedtuple

2008-06-08 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Found it. Py3.0 uses protocol 2 by default and that protocol has a different set of calls. -- versions: +Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> __

[issue2618] Tile module: Add support for themed widgets

2008-06-08 Thread Kevin Walzer
Kevin Walzer <[EMAIL PROTECTED]> added the comment: I would like to close this feature request in favor of http://bugs.python.org/issue2983. That project achieves the same goal as this code submission in a more comprehensive, better-documented fashion. ___ P

[issue3065] Fix pickling bug of collections.namedtuple

2008-06-08 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Georg, this works fine in Py2.6 but not in Py3.0. Do you know what changed and whether other pickles will fail? -- assignee: rhettinger -> georg.brandl nosy: +georg.brandl versions: -Python 2.6 _

[issue2983] Ttk support for Tkinter

2008-06-08 Thread Kevin Walzer
Changes by Kevin Walzer <[EMAIL PROTECTED]>: -- nosy: +wordtech ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing

[issue3065] Fix pickling bug of collections.namedtuple

2008-06-08 Thread Raymond Hettinger
Changes by Raymond Hettinger <[EMAIL PROTECTED]>: -- priority: normal -> high ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs

[issue3065] Fix pickling bug of collections.namedtuple

2008-06-08 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti <[EMAIL PROTECTED]>: There is currently a pickling bug in the namedtuple factory: >>> from collections import namedtuple >>> MemoRecord = namedtuple("MemoRecord", "key, msg") >>> m = MemoRecord(1,"hello") >>> import pickle >>> pickle.loads(pickl

[issue3064] new turtle module for Python 3.0

2008-06-08 Thread Gregor Lingl
New submission from Gregor Lingl <[EMAIL PROTECTED]>: turtle3.zip contains the port of the new turtle module (including demo viewer and demo scripts) to Python 3.0 . One demo script has been added (tdemo_forest.py) It has been tested under Windows/MacOsX/Linux without showing up any problems.

[issue2775] Implement PEP 3108

2008-06-08 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- dependencies: -Remove cl usage from aifc, Write UserDict fixer for 2to3 ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue2876] Write UserDict fixer for 2to3

2008-06-08 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- priority: release blocker -> high ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Py

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

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Can't you just inherit PyStructSequence with tp_base? -- nosy: +benjamin.peterson ___ Python tracker <[EMAIL PROTECTED]> __

[issue3060] Warn about tuple parameters

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Done with r64045. -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Done in r64044. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue2053] IDLE - standardize dialogs

2008-06-08 Thread Tal Einat
Changes by Tal Einat <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10556/IDLE_standardize_dialogs.080609.patch ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue2053] IDLE - standardize dialogs

2008-06-08 Thread Tal Einat
Changes by Tal Einat <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10555/IDLE_standardize_dialogs.080609.patch ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue2053] IDLE - standardize dialogs

2008-06-08 Thread Tal Einat
Tal Einat <[EMAIL PROTECTED]> added the comment: After more testing, I discovered a bug which broke Goto Line. Attaching a fixed patch. Added file: http://bugs.python.org/file10555/IDLE_standardize_dialogs.080609.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue2911] rewrite test_struct as a unittest

2008-06-08 Thread Giampaolo Rodola'
Giampaolo Rodola' <[EMAIL PROTECTED]> added the comment: In attachment. All existing tests are unchanged. All tests passed on Windows XP sp3 and Linux Ubuntu Breezie both equipped with Python-2.6a3. -- keywords: +patch nosy: +giampaolo.rodola Added file: http://bugs.python.org/file10554/

[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: The macro at the top of the patch should be removed, then this can be checked in. -- resolution: -> accepted ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3060] Warn about tuple parameters

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Replace "upacking" with "unpacking" and you can commit it :) ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3063] memory leak in random number generation

2008-06-08 Thread Tim Peters
Tim Peters <[EMAIL PROTECTED]> added the comment: Float objects also require, as do all Python objects, space to hold a type pointer and a reference count. So each float object requires at least 16 bytes (on most 32-bit boxes, 4 bytes for the type pointer, 4 bytes for the refcount, + 8 bytes for

[issue3063] memory leak in random number generation

2008-06-08 Thread Facundo Batista
Facundo Batista <[EMAIL PROTECTED]> added the comment: Grant, A float takes 64 bits. 100 million floats take 800 MB, *just* the floats. You're also building a list of 100 million places. Maybe you shouldn't be building this structure in memory? In any case, you should raise this issue in comp.

[issue3060] Warn about tuple parameters

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > Why not warn in the AST, like for the other syntax-related changes? because I was reading through symtable.c at the time. :) Anyway, here's a better patch. Added file: http://bugs.python.org/file10553/tuple_parameters_warn2.patch

[issue3063] memory leak in random number generation

2008-06-08 Thread Grant Tang
Grant Tang <[EMAIL PROTECTED]> added the comment: Facundo: I understand now. You mean every unique float number used will be an object in memory. And never been released until Python quit. Is there any way to reclaim these memory? We need 3G memory to create a list of 100million randum numbers.

[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Here's a much better patch that delegates checking to a helper. Added file: http://bugs.python.org/file10551/bool_assign7.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue3063] memory leak in random number generation

2008-06-08 Thread Facundo Batista
Facundo Batista <[EMAIL PROTECTED]> added the comment: So, 0.0 would be cached, and the 414m+384m would be from the list itself, right? I tried, >>> data = [(1.0/i) for i in xrange(1,1)] And the memory consumption was the big one. Grant, the 800 MB is taken by ONE 0.0, and a list of zi

[issue3063] memory leak in random number generation

2008-06-08 Thread Grant Tang
Grant Tang <[EMAIL PROTECTED]> added the comment: Here I am confused. 100million floats in a list takes about 800M byte memory. This is acceptable. for i in xrange(1): data[i] = random() so it should be 800M plus a float returned by random(). But the problem is after this loop, e

[issue3063] memory leak in random number generation

2008-06-08 Thread Tim Peters
Tim Peters <[EMAIL PROTECTED]> added the comment: They stayed alive simultaneously because you stored 100 million of them simultaneously in a list (data[]). If instead you did, e.g., for i in xrange(1): x = random() the problem would go away -- then only two float objects are simul

[issue3063] memory leak in random number generation

2008-06-08 Thread Grant Tang
Grant Tang <[EMAIL PROTECTED]> added the comment: I agree with Tim's comment. The problem's why these floats keep alive even after random() call returns. Then this becomes a garbage collection issue? ___ Python tracker <[EMAIL PROTECTED]>

[issue3063] memory leak in random number generation

2008-06-08 Thread Tim Peters
Tim Peters <[EMAIL PROTECTED]> added the comment: Strongly doubt this has anything to do with random number generation. Python maintains a freelist for float objects, which is both unbounded and immortal. Instead of doing "data[i] = random()", do, e.g., "data[i] = float(s)", and I bet you'll se

[issue3063] memory leak in random number generation

2008-06-08 Thread Facundo Batista
Facundo Batista <[EMAIL PROTECTED]> added the comment: Confirmed the issue in the trunk right now: (the number between square brackets point to the 'top' information below) [EMAIL PROTECTED]:~/devel/reps/python/trunk$ ./python Python 2.6a3+ (trunk:64009, Jun 7 2008, 09:51:56) [GCC 4.2.3 (Ubu

[issue3063] memory leak in random number generation

2008-06-08 Thread Grant Tang
New submission from Grant Tang <[EMAIL PROTECTED]>: #the following code consume about 800M memory, which is normal n = 1 data = [0.0 for i in xrange(n)] #however, if I assign random number to data list, it will consume extra 2.5G memory. from random import random for s in xrange(n):

[issue3028] tokenize module: normal lines, not "logical"

2008-06-08 Thread Noam Raphael
Noam Raphael <[EMAIL PROTECTED]> added the comment: Can I suggest that you also add something like "The row indices in the (row, column) tuples, however, are physical, and don't treat continuation lines specially."? It's just that it took me some time to understand your clarification, since the

[issue1350] IDLE - CallTips enhancement - show full doc-string in new window

2008-06-08 Thread Tal Einat
Changes by Tal Einat <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file8960/IDLE_CallTips.071214.incremental.patch ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue1350] IDLE - CallTips enhancement - show full doc-string in new window

2008-06-08 Thread Tal Einat
Changes by Tal Einat <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file8641/IDLE_CallTips.071028.patch ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3062] Turtle speed() function has no effect under Mac OS X

2008-06-08 Thread Pierre Bourdon
New submission from Pierre Bourdon <[EMAIL PROTECTED]>: When using the speed() function of the turtle module under Mac OS X, it has no effect : the turtle always draws lines with the same speed. An easy fix is to replace line 553 of the turtle.py file by "sleep(self._delay / 1000.0)", however

[issue2523] binary buffered reading is quadratic

2008-06-08 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Thanks for the fixes. By the way, I don't know much about non-blocking streams, but it seems to me that "optimal" non-blocking read() would require that the chunks we ask to the OS are block-aligned, which is not the case currently (we use 2*

[issue3028] tokenize module: normal lines, not "logical"

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I got it wrong too at first; the "logical line" refers to the last tuple item, the line string, not the line *number* passed. It should now be clear as of r64037. -- resolution: -> fixed status: open -> closed ___

[issue3061] time.strftime() always decodes result with UTF-8

2008-06-08 Thread Georg Brandl
New submission from Georg Brandl <[EMAIL PROTECTED]>: It decodes the system strftime's result using TZNAME_ENCODING which is also used to decode timezone names. This may be correct for timezone names themselves (I don't know), but the strftime result is encoded in the LC_TIME encoding - at least

[issue3059] Removing .decode calls from Lib/calendar.py

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Thanks, committed in r64033. -- nosy: +georg.brandl resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue3056] Simplify the Integral ABC

2008-06-08 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Is the patch good to go? ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list

[issue3060] Warn about tuple parameters

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Also a test is missing. ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list maili

[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Hmm, I'd even go a step further and factor out the whole checking for invalid/warnable names, like in Py3k's forbidden_name. Also the warning text shouldn't start with uppercase and end in a full stop. ___ P

[issue3060] Warn about tuple parameters

2008-06-08 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Why not warn in the AST, like for the other syntax-related changes? The relevant location is ast_for_arguments, line 680 in current SVN. ___ Python tracker <[EMAIL PROTECTED]>