[issue2043] test_cl.py converted to unittest

2008-02-08 Thread Facundo Batista

Changes by Facundo Batista:


--
keywords: +easy

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2043
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2048] Python 2.5.1 woes on IRIX, Solaris

2008-02-08 Thread Atro Tossavainen

New submission from Atro Tossavainen:

Building and testing on Solaris 8 on SPARC with Sun compilers:
cc: Sun C 5.8 2005/10/13
CC: Sun C++ 5.8 2005/10/13

281 tests OK.
40 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_ctypes
test_curses test_gdbm test_gl test_imgfile test_linuxaudiodev
test_macfs test_macostools test_nis test_normalization
test_ossaudiodev test_pep277 test_plistlib test_scriptpackages
test_socket_ssl test_socketserver test_sqlite test_startfile
test_sunaudiodev test_tcl test_timeout test_unicode_file
test_urllib2net test_urllibnet test_winreg test_winsound
test_zipfile64
4 skips unexpected on sunos5:
test_tcl test_sunaudiodev test_ctypes test_nis

...
test_tcl skipped -- No module named _tkinter
...

I have applied the _ctypes patch in #1516, however.  What gives?

Building and testing on IRIX 6.5.30 with MIPS compilers 7.4.4, the test
suite fails to complete:

test_xml_etree
gmake: *** [test] Segmentation fault

--
components: Build, Tests
messages: 62194
nosy: atossava
severity: normal
status: open
title: Python 2.5.1 woes on IRIX, Solaris
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2048
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2039] Pymalloc patch for int and float objects

2008-02-08 Thread Andrew I MacIntyre

Andrew I MacIntyre added the comment:

As indicated in a python-dev posting, I'm adding my experimental grade
patches removing the freelists from ints and floats.

Subject to testing on other platforms (I've only tested on FreeBSD 6.1
and OS/2), I suggest that the float case should be seriously considered,
as there seems little advantage to the complexity of the freelist, with
better memory utilisation likely to flow from relying on PyMalloc on top
of being faster than the current freelist implementation (for reasons
unknown; the version in tiran's patch performs similar to the
no-freelist patch).

The int freelist is enough ahead in performance (although only 3-5%) to
justify ignoring the better memory utilisation of dropping the freelist.

--
nosy: +aimacintyre
Added file: http://bugs.python.org/file9392/no-intfloat-freelist.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2039
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2050] IDLE - make ScriptBinding event handlers return 'break'

2008-02-08 Thread Tal Einat

New submission from Tal Einat:

Event handlers in ScriptBinding.py were not returning 'break', although
they should have been.

--
components: IDLE
files: IDLE_ScriptBinding.080208.patch
messages: 62196
nosy: kbk, taleinat
severity: minor
status: open
title: IDLE - make ScriptBinding event handlers return 'break'
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file9391/IDLE_ScriptBinding.080208.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2050
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2049] IDLE - Restart Shell Run Module

2008-02-08 Thread Facundo Batista

Changes by Facundo Batista:


--
keywords: +patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2049
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2049] IDLE - Restart Shell Run Module

2008-02-08 Thread Tal Einat

New submission from Tal Einat:

When IDLE is run with a subprocess, add a 'Restart Shell  Run Module'
item to the 'Run' menu in editor windows. Also add Alt-F5 as a hotkey
for this item.

This is what the 'Run Module' (F5) item used to do (when there was a
subprocess). As of this patch 'Run Module' will not restart the shell
under any circumstances.


The advantages of this are that the user has more control (can run a
module in the shell either with or without restarting). It also avoids
surprising users which wouldn't expect 'Run Module' to restart the shell.


Based on changes proposed by Doug on idle-dev:
http://mail.python.org/pipermail/idle-dev/2007-January/002541.html

--
components: IDLE
files: IDLE_restart_shell_and_run_module.080208.patch
messages: 62195
nosy: kbk, taleinat
severity: normal
status: open
title: IDLE - Restart Shell  Run Module
type: behavior
versions: Python 2.5, Python 2.6
Added file: 
http://bugs.python.org/file9390/IDLE_restart_shell_and_run_module.080208.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2049
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2027] Module containing C implementations of common text algorithms

2008-02-08 Thread Georg Brandl

Georg Brandl added the comment:

Even PHP includes Levenshtein... ;)

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2027
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1037516] ftplib PASV error bug

2008-02-08 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

 If ftplib gets an error while doing the PASV
 section of the ntransfercmd it dies.

Which kind of error? What do you mean by dies?
If the server returns an error response while ftplib is attempting to
open a passive data channel it is expected that an exception is raised.

--
nosy: +giampaolo.rodola

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1037516
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2008-02-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Can you write a test to catch this problem? The patch should preferably
be against the latest svn source.

--
nosy: +draghuram

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2047
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1960] test_gdbm.py converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1960
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2024] test_gl.py converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2024
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2026] test_largefile.py converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2026
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2042] test_audioop.py converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2042
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2044] test_sunaudiodev.py converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2044
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2046] patch to fix_import: UserDict - collections

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
assignee: collinwinter - tiran
keywords: +patch
nosy: +tiran
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2046
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2043] test_cl.py converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal
type:  - behavior

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2043
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2008-02-08 Thread Christian Heimes

Christian Heimes added the comment:

The fix may get into 2.5 but definitely not into 2.4 because it's not a
security fix.

--
components: +Windows
keywords: +patch
nosy: +tiran
priority:  - normal
versions: +Python 2.5, Python 2.6 -Python 2.4

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2047
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2040] Class instance attributes that are property() should appear in __dict__

2008-02-08 Thread Christian Heimes

Christian Heimes added the comment:

Please take the question to the Python general mailing list. I'm sure
several people are able to explain it to you. The bug tracker isn't the
right place.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2040
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2050] IDLE - make ScriptBinding event handlers return 'break'

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
assignee:  - kbk
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2050
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2023] test_cd converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2023
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2049] IDLE - Restart Shell Run Module

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
assignee:  - kbk
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2049
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2022] test_al converted to unittest

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2022
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2008-02-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

I added couple of test cases. Please see the patch shutil_destinsrc.patch.

Added file: http://bugs.python.org/file9393/shutil_destinsrc.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2047
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2008-02-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Christian, do you mind testing on windows? I tested only on Linux.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2047
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2008-02-08 Thread Christian Heimes

Christian Heimes added the comment:

You have a good use case for a change of behavior. We might change it
for Python 2.6 and 3.0.

A proper place would be Python/import.c:load_source_module().

--
components: +Interpreter Core -None
nosy: +tiran
priority:  - high
versions: +Python 2.6 -Python 2.4

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2051
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2008-02-08 Thread stocker81

stocker81 added the comment:

BTW, I see you've removed this issue from bugs list printed at
http://bugs.python.org/ but everyone (including unlogged visitors) can
access it still via http://bugs.python.org/issue2051 ...

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2051
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2008-02-08 Thread stocker81

New submission from stocker81:

Python's interpreter doesn't keep proper file permissions after
importing library. See the fallowing:

[EMAIL PROTECTED] ~ $ echo key='top secret'  key.py
[EMAIL PROTECTED] ~ $ chmod 600 key.py 
[EMAIL PROTECTED] ~ $ python
Python 2.4.4 (#1, Jan  8 2008, 21:22:16) 
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.1)] on linux2
Type help, copyright, credits or license for more information.
 import key
 
[EMAIL PROTECTED] ~ $ ls -l key.py*
-rw--- 1 mk mk  17 II  8 20:09 key.py
-rw-r--r-- 1 mk mk 120 II  8 20:09 key.pyc
[EMAIL PROTECTED] ~ $ 

So, interpreter creates 644 pyo file (visible for all) which contains
secret data from 600 py file.
I think it should keep the original permissions, someone can save a
important data (eg. SQL login/pwd into Django's settings.py) into
library and makes it visible for all by an accident.

--
components: None
messages: 62203
nosy: stocker81
severity: normal
status: open
title: PYO file permission problem
type: security
versions: Python 2.4

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2051
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue549764] Uninstall target in makefile

2008-02-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

no activity and no patch.

--
nosy: +draghuram
status: open - closed


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue549764

___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2052] Lack of difflib.HtmlDiff unicode support

2008-02-08 Thread josephoenix

New submission from josephoenix:

When passed unicode strings, difflib.HtmlDiff.make_file and make_table 
fail with a UnicodeEncodeError. Also, the html outputted by make_file 
seems to be hardcoded to use charset=ISO-8859-1 (line 1584 of difflib.py)

--
components: Library (Lib)
messages: 62208
nosy: josephoenix
severity: normal
status: open
title: Lack of difflib.HtmlDiff unicode support
type: behavior
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2052
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2008-02-08 Thread Christian Heimes

Christian Heimes added the comment:

stocker81 wrote:
 BTW, I see you've removed this issue from bugs list printed at
 http://bugs.python.org/ but everyone (including unlogged visitors) can
 access it still via http://bugs.python.org/issue2051 ...

I haven't removed it from the listing. Look under priority high a few
pages up.

Christian

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2051
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2052] Lack of difflib.HtmlDiff unicode support

2008-02-08 Thread josephoenix

josephoenix added the comment:

After installing 2.5.1, the UnicodeEncodeError is gone, but the charset is 
still hardcoded in difflib._file_template. So, I guess this is still a 
separate bug.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2052
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2052] Lack of difflib.HtmlDiff unicode support

2008-02-08 Thread josephoenix

josephoenix added the comment:

Oops, please close this. Apparently was fixed in 2.5.1, and I'm just 
behind.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2052
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2048] Python 2.5.1 woes on IRIX, Solaris

2008-02-08 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Please don't mix several unrelated issues in a single report, else it is
difficult to keep track which aspects have been resolved and which need
further attention. This is particularly true for a report of breakage on
a minority platform, which could easily remain unresolved for years.

As for Solaris: What is the specific problem that you are reporting?
I.e. what behavior did you expect instead?

--
nosy: +loewis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2048
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2053] IDLE - standardize dialogs

2008-02-08 Thread Tal Einat

New submission from Tal Einat:

In many places in the code, tkMessageBox dialogs were being used
directly, with the master (parent) widget being set explicitly to the
EditorWindow's text widget. Only in some cases was the focus being set
to the text widget afterwards, although in most this is the Right Thing
To Do.

This patch adds a decorator which wraps a tkMessage box (or similar)
function to use the EditorWindow's text widget as a parent by default
and set focus back to it afterwards. This is used to wrap the showerror
and ask* methods. It also changes the code to use these methods wherever
appropriate.

All in all, the change in functionality is that the dialogs' parent
widget will always be the text widget, and that focus will always be
returned to it. This makes the interface more consistent. As a bonus, a
lot of repetitive cruft is removed from the code, and writing extensions
is made another bit simpler.

--
components: IDLE
files: IDLE_standardize_dialogs.080208.patch
messages: 62214
nosy: kbk, taleinat
severity: normal
status: open
title: IDLE - standardize dialogs
versions: Python 2.5, Python 2.6
Added file: 
http://bugs.python.org/file9394/IDLE_standardize_dialogs.080208.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2053
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2053] IDLE - standardize dialogs

2008-02-08 Thread Tal Einat

Tal Einat added the comment:

Bah, the initial version contained a silly bug in
EditorWindow.goto_line_event. Please remove it, and use this version
instead.

Added file: 
http://bugs.python.org/file9395/IDLE_standardize_dialogs.080209.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2053
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2053] IDLE - standardize dialogs

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
assignee:  - kbk
keywords: +patch
priority:  - normal
type:  - rfe
versions:  -Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2053
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2053] IDLE - standardize dialogs

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


Removed file: 
http://bugs.python.org/file9394/IDLE_standardize_dialogs.080208.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2053
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2054] add ftp-tls support to ftplib - RFC 4217

2008-02-08 Thread Gregory P. Smith

New submission from Gregory P. Smith:

ftplib does not support ftp over SSL / TLS as described in RFC 4217. 
This would be a nice thing for someone wanting to contribute something
to add.

--
components: Library (Lib)
messages: 62217
nosy: gregory.p.smith
severity: normal
status: open
title: add ftp-tls support to ftplib - RFC 4217
type: rfe
versions: Python 2.6, Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2054
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2054] add ftp-tls support to ftplib - RFC 4217

2008-02-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +easy
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2054
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-08 Thread Jeffrey Yasskin

Jeffrey Yasskin added the comment:

I figured I'd time the difference before we change the code:

$ ./python.exe -m timeit -s 'import rational; r=rational.Rational(3, 1)'
'r.numerator'
100 loops, best of 3: 0.696 usec per loop
$ ./python.exe -m timeit -s 'import rational; r=rational.Rational(3, 1)'
'r._numerator'
1000 loops, best of 3: 0.155 usec per loop
$ ./python.exe -m timeit -s '(3).numerator'
1000 loops, best of 3: 0.0324 usec per loop
$ ./python.exe -m timeit -s '(3L).numerator'
1000 loops, best of 3: 0.0356 usec per loop
$ ./python.exe -m timeit -s 'from rational import Rational' 'Rational(3,
1)'  
1 loops, best of 3: 80.4 usec per loop
$ ./python.exe -m timeit -s 'from rational import Rational;
r=Rational(3, 1)' 'isinstance(r, Rational)'
10 loops, best of 3: 10.6 usec per loop

So every time we change .numerator to ._numerator we save half a
microsecond. If we construct a new Rational from the result, that's
totally drowned out by the Rational() call. Even checking whether we're
looking at a Rational costs 20 times as much as the difference, although
that can probably be optimized. I think this means that we shouldn't
bother changing the arithmetic methods since it makes the code more
complicated, but changing unary methods, especially ones that don't
return Rationals, can't hurt.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com