[issue4911] Windows installer Quad processor issues

2009-03-21 Thread Martin v. Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Can you please run the Python installer with

 msiexec /i pythonxy.msi /l*v python.log

and compress and attach the resulting log file?

--
nosy: +loewis

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



[issue4735] An error occurred during the installation of assembly

2009-03-21 Thread Martin v. Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Can you please run the Python installer with

 msiexec /i pythonxy.msi /l*v python.log

and compress and attach the resulting log file?

--
nosy: +loewis

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



[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-03-21 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Reclassifying as a documentation bug, since PEP 377 was rejected by Guido.

--
components: +Documentation -None

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



[issue1498930] Generate from Unicode database instead of manualy coding.

2009-03-21 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

You may not know it, but these functions are generated from the Unicode
database. 

However, because these functions need to be fast and are small enough,
they were not converted to the unicodetype_db approach and instead left
as they were originally implemented: as switch statements for the
compilers to optimize.

Is there any reason why this would need to change for Unicode 5.0 ?

--
nosy: +lemburg

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



[issue1337876] Inconsistent use of buffer interface in string and unicode

2009-03-21 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

This looks like a useful addition for Python 2.x - not sure about 3.x,
since that doesn't have the 2.x buffer interface anymore.

Phil, could you update the patch for Python 2.7.

--
nosy: +lemburg
versions:  -Python 3.1

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



[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson

New submission from Tim Cuthbertson tim3d.j...@gmail.com:

This patch adds the behaviour that when a unittest.failureException is
thrown in a TestCase's tearDown method, the test case is added to the
failures list (instead of the errors list, and only when the test case
body has passed successfully).

In some circumstances, tests may want to assert that something happens
at some point during the body of a test, and the best time to make these
checks can be in the tearDown method.

This is a modification I've made during development of my mocktest
library (https://github.com/gfxmonk/mocktest/tree), and I believe it is
beneficial to have as the default unittest behaviour.

--
components: Extension Modules
files: unittest-fail-on-teardown-0.patch
keywords: patch
messages: 83927
nosy: gfxmonk
severity: normal
status: open
title: unittest: allow failures in tearDown method
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13387/unittest-fail-on-teardown-0.patch

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



[issue1475397] compute/doc %z os-indep., time.asctime_tz / _TZ

2009-03-21 Thread kxroberto

kxroberto kxrobe...@users.sourceforge.net added the comment:

(I'm somewhat away from all that currently - and not aware if newest
Python versions already solved but:)

* a time.asctime_tz([tim]) or so should deliver a full OS-indep.
_world_ time string incl. numeric timezone info like 
Sat Mar 21 10:33:36 2009 +
It should accept a 10-tuple (like urlopen_file.info().getdate_tz('date'),
or a time.time() float time, 
or interpret a 9-tuple as GMTIME/UTC.

* strftime(%z) should be supported on all OS - _constant numeric_
format + 

* strftime(%C,[tim]) should be like asctime_tz.
  it should accept as 2nd parameter a 10-tuple alternatively, 
  or a time.time() universal float time, 
  or interpret the 9-tuple as LOCALTIME as it were.

test cases to add: 
* simple render a variation of constant tuples/float_times to constant
result strings.

--

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



[issue1475397] time.asctime_tz, time.strftime %z %C

2009-03-21 Thread kxroberto

Changes by kxroberto kxrobe...@users.sourceforge.net:


--
title: compute/doc %z os-indep., time.asctime_tz / _TZ - time.asctime_tz, 
time.strftime %z %C

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



[issue1459867] Message.as_string should use mangle_from_=unixfrom?

2009-03-21 Thread kxroberto

kxroberto kxrobe...@users.sourceforge.net added the comment:

g = Generator(fp,mangle_from_=unixfrom)
in that code location below? 
It produced exceptions often when message lines (or headerlines e.g.
Subject also when I remember right) begin with the char  or so.

--- Message.py.orig 2004-12-22 16:01:38.0 +0100
+++ Message.py  2006-03-28 10:59:42.0 +0200
@@ -126,7 +126,7 @@
 
 from email.Generator import Generator
 fp = StringIO()
-g = Generator(fp)
+g = Generator(fp,mangle_from_=unixfrom)
 g.flatten(self, unixfrom=unixfrom)
 return fp.getvalue()

--
title: convenient Message.as_string to use mangle_from_=unixfrom ? - 
Message.as_string should  use mangle_from_=unixfrom?

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



[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson

Tim Cuthbertson tim3d.j...@gmail.com added the comment:

updated patch: made the test method name unique (oops), and added the
specific test case where both test body and tearDown raise failure
exceptions. This patch supercedes the original (v0)

--
Added file: http://bugs.python.org/file13388/unittest-fail-on-teardown-1.patch

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



[issue5463] Remove deprecated features from struct module

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks!  Committed your patch in r70497.

I think _PY_STRUCT_RANGE_CHECKING can also be removed from the module and 
the tests (treated as though it's 1 throughout).  In theory there could be 
people using it, but it's not documented and the leading underscore in the 
name clearly indicates that its supposed to be private, so I think it's 
safe to remove.  It looks like it was there just to enable some extra 
tests (tests that were broken with earlier versions of the struct module 
thanks to struct bugs).

I agree that we should bump the version number once we're done here.

I really appreciate this work:  the struct module has been in need of 
cleanup for a while.  Thank you again.

--

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



[issue5524] execfile() removed from Python3

2009-03-21 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Ok... but there is the newline issue: (self quote) 
 exec() doesn't support newline different than \n, 
 see issue #4628.

 So that issue should get fixed, then.

Ok, I will work in the other other issue. If #4628 is fixed, this 
issue becomes meaningless ;-)

--
dependencies: +No universal newline support for compile() when using bytes

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



[issue4282] profile doesn't support non-UTF8 source code

2009-03-21 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

After some discussions, I think that my first patch 
(profile_encoding.patch) was correct but we also have to fix #4628.

--
dependencies: +No universal newline support for compile() when using bytes

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



[issue1503789] Cannot write source code in UTF16

2009-03-21 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Detect UTF-16 and UTF-32 is complex. I think that we can first support 
UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE with BOM. Most editors add a 
BOM (eg. notepad.exe on Windows). I will try to fix this issue.

--

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



[issue2706] datetime: define division timedelta/timedelta

2009-03-21 Thread webograph

webograph webogr...@eml.cc added the comment:

i don't think this can be solved in a way that is independent of the
chosen unit, as it requires a concept of whole time-units (as in
whole numbers); whether these be seconds or minutes would be
completely arbitrary.

(`5 minutes % 3 = 0 minutes` would be true if based on seconds because
`5 minutes = 3 * 100 seconds + 0 minutes` but `5 minutes % 3 = 2
minutes` based on minutes because `5 minutes = 3 * 1 minute + 2 minutes`.)

--

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



[issue1492860] Integer bit operations performance improvement.

2009-03-21 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +marketdickinson

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



[issue1492860] Integer bit operations performance improvement.

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

To see what Tim's talking about here, see the 'big switch' (switch 
opcode) in function PyEval_EvalFrameEx in Python/ceval.c, and look at the 
case BINARY_ADD bit.  Inlining the bitwise operators should be even 
easier, since there are no overflow worries.  (We do have to assume that C 
longs are two's-complement with no trap representation, but 
Objects/intobject.c does that already, so it's probably okay.)

This only applies to 'short' integers, so I don't think it's relevant for 
Python 3.x.

--
keywords: +easy
stage: test needed - needs patch
versions:  -Python 3.1

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



[issue1296434] Call by object reference sometimes call by value

2009-03-21 Thread Alan G

Alan G abgro...@users.sourceforge.net added the comment:

Lol!  After four years I could hardly claim to care anymore...

--

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



[issue1296434] Call by object reference sometimes call by value

2009-03-21 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
resolution:  - works for me
status: pending - closed

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

I think the best we can do is return valid comparison results between
floats and decimals in 2.x.  It doesn't make anything worse and it does
make something better.  Unlike other cross-type comparisons,
number-to-number is not an unreasonable thing to do.  And, we not
obliged to carry that over to 3.x where cross-type comparisons have to
be specifically enabled.  I believe this is the best solution.

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

The next to last sentence should have read and, we are not
obliged to carry that over to 3.x where cross-type ordering comparisons
are not the norm unless a type has specifically enabled them.

The gist of the idea is that in 2.x, we do have cross-type ordering
comparisons so we should make them as useful and non-misleading as
possible.  But, in 3.x there is no default cross-type ordering
comparisons so we're not obliged to return any answer at all.

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

What about Decimal - Fraction comparisons?

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

It's not a priority for me though it's not an unreasonable thing to do.
 A basic 5th grade exercise is ordering fractions, sometimes with their
decimal equivalents:Fraction(1,3)  Decimal('0.4')  Fraction(1,2).
 I don't care if that gets done.  

If you do decide to do fractions too, the responsibility should be with
the fractions class (since decimals convert to fractions exactly but not
vice-versa).

--

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



[issue5532] imap usage in itertools unique_justseen recipe

2009-03-21 Thread Michael Newman

New submission from Michael Newman michael.b.new...@gmail.com:

The recipe for unique_justseen listed on:
http://docs.python.org/3.0/library/itertools.html
uses imap, which is not available in Python 3.0.

I fixed it by changing imap to just map, and I also changing
itemgetter to operator.itemgetter to make the namespace usage
clearer in the recipe:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type help, copyright, credits or license for more information.
 from itertools import *
 import operator
 def unique_justseen(iterable, key=None):
... List unique elements, preserving order. Remember only the
element just
seen.
... # unique_justseen('BBBCCDAABBB') -- A B C D A B
... # unique_justseen('ABBCcAD', str.lower) -- A B C A D
... return map(next, map(operator.itemgetter(1), groupby(iterable,
key)))
...
 unique_justseen('BBBCCDAABBB')
map object at 0x00BB2690
 list(unique_justseen('BBBCCDAABBB'))
['A', 'B', 'C', 'D', 'A', 'B']
 unique_justseen('ABBCcAD', str.lower)
map object at 0x00BB2650
 list(unique_justseen('ABBCcAD', str.lower))
['A', 'B', 'C', 'A', 'D']


--
assignee: georg.brandl
components: Documentation
messages: 83943
nosy: georg.brandl, mnewman
severity: normal
status: open
title: imap usage in itertools unique_justseen recipe
versions: Python 3.0

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Here's a patch.

I'm still not 100% convinced this is a good idea.  Part of my objection is 
that it seems likely that these comparisons are fairly useless, in that a 
mixed-type comparison is probably going to be followed by a mixed-type 
arithmetic operation at some point (unless people are misspelling x  0 
as x  0.0).  So all that's really gained is a noisy failure instead of 
a silent one.  Still, I suppose that's something.

--
keywords: +patch
resolution: rejected - 
stage:  - patch review
status: closed - open
versions: +Python 2.7 -Python 2.5, Python 2.6
Added file: http://bugs.python.org/file13389/float_decimal_comparisons.patch

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



[issue5533] unittest can't deal with packages

2009-03-21 Thread Aristotelis Mikropoulos

New submission from Aristotelis Mikropoulos amik...@gmail.com:

There is a problem with unittest, as it cannot handle package imports.
This http://dpaste.com/17315/ proves it.

--
components: Library (Lib)
messages: 83945
nosy: Indy
severity: normal
status: open
title: unittest can't deal with packages
type: behavior
versions: Python 2.5

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



[issue5533] unittest can't deal with packages

2009-03-21 Thread Jean-Paul Calderone

Jean-Paul Calderone exar...@divmod.com added the comment:

dpaste.com will eventually discard your proof.  You should include all
information for a bug report on the tracker.  You can include the code
in a comment or attach it to the ticket as a file.

--
nosy: +exarkun

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



[issue5533] unittest can't deal with packages

2009-03-21 Thread Aristotelis Mikropoulos

Aristotelis Mikropoulos amik...@gmail.com added the comment:

You are right, here is the file.

--
Added file: http://bugs.python.org/file13390/test

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



[issue5532] imap usage in itertools unique_justseen recipe

2009-03-21 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
assignee: georg.brandl - rhettinger
nosy: +rhettinger

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

On the other hand, if it's true that mixed-type comparisons are generally 
followed by mixed-type arithmetic, then these comparisons just become a 
roundabout way to raise TypeError, which is what everybody wanted in the 
first place. :-)

The patch still needs docs.

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee: marketdickinson - rhettinger

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



[issue5532] imap usage in itertools unique_justseen recipe

2009-03-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Benjamin, please revert r69354 which was an incorrect merge.

--
assignee: rhettinger - benjamin.peterson
nosy: +benjamin.peterson

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Urk.  That patch produces horrible results when comparing Fractions and 
Decimals:

Python 2.7a0 (unknown, Mar 21 2009, 17:59:48) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type help, copyright, credits or license for more information.
 from fractions import Fraction
 from decimal import Decimal
 Decimal('2.5') == Fraction(5, 2)
True
 Decimal('1.1') == Fraction(11, 10)
False

Either both results should be True (if comparisons between Fractions and 
Decimals work numerically), or both should be False (refuse to
compare Fraction and Decimal).

It looks like what happens is that the Fraction comparison converts the 
second argument to float before comparing. I'm tempted to call this a 
bug in Fraction.__eq__.

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

One more consideration:  if Decimal('2.5') == 2.5 is True, should we also 
be fixing the Decimal hash method so that hash(Decimal('2.5')) == 
hash(2.5)?

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

I'll look at this more later today.

--

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



[issue5512] Streamline integer division

2009-03-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Updated patch.  Lots of cleanup, but only one significant change:  the 
inner loop now uses signed arithmetic instead of unsigned arithmetic.  This 
saves a negation and fixes a subtle bug: the previous inner loop code 
was incorrect when using 15-bit digits on machines with sizeof(short) == 
sizeof(long).  Not that I know of any such machines:  the Cray T3E 
famously has no 16-bit integer type, but there sizeof(short) is 4 and 
sizeof(long) is 8.

A few more timings, this time from doing a single huge integer division:  
10**100//10**50 (so this effectively times just the inner loop, 
since all else will be insignificant).  All timings are best-of-5, from 
non-debug builds of py3k, on the same system: OS X 10.5.6/2.4 GHz Core 2 
Duo.  Times in brackets are the approximate per-inner-loop times 
(remembering that there are 4 times as many iterations of the inner loop 
for 15-bit digits).

32-bit build, 15-bit digits, unpatched:  92382.2 ms   (~7.5 ns)
32-bit build, 15-bit digits, patched:36473.3 ms   (~3.0 ns)
64-bit build, 30-bit digits, unpatched:  14581.4 ms   (~4.8 ns)
64-bit build, 30-bit digits, patched: 7385.1 ms   (~2.4 ns)

... and just for fun, the other combinations:

64-bit build, 15-bit digits, unpatched:  61927.5 ms   (~5.1 ns)
64-bit build, 15-bit digits, patched:43632.9 ms   (~3.6 ns)
32-bit build, 30-bit digits, unpatched:  62374.1 ms  (~20.3 ns)
32-bit build, 30-bit digits, patched:26928.3 ms   (~8.8 ns)


Thanks for the updated pidigits script, Victor!  Maybe this is too small 
right now to be worth including in the Tools directory, but I hope we can 
fatten it up with some other benchmarks.  What do you think?

--
Added file: http://bugs.python.org/file13391/faster_integer_division2.patch

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



[issue5525] Problem with email.MIME* library, using wrong new line

2009-03-21 Thread Luca clementi

Luca clementi luca.cleme...@gmail.com added the comment:

I forgot to say that the 
\n
should be substitute with 
\r\n
CRLF

Luca

--

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



[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

So I disagree with this idea. The point of a tearDown method is simply
to clean up, not to test for a failure. If the test failed because it
didn't complete a test and clean up after itself then the test should
fail explicitly, not have the tearDown do it for the test.

--
components: +Library (Lib) -Extension Modules
nosy: +brett.cannon
stage:  - patch review
type:  - feature request

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



[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

I concur with Brett.

--
nosy: +rhettinger

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



[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson

Tim Cuthbertson tim3d.j...@gmail.com added the comment:

I agree that this is not normally the point of tearDown methods.
However, allowing it reduces repetition when you want to verify that
some invariant is not violated by any test.

I also think that as far as the test writer is concerned, an assertion
error is a failed test - regardless of where in the code it came from.

--

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



[issue5381] json needs object_pairs_hook

2009-03-21 Thread Lim Chee Aun

Changes by Lim Chee Aun chee...@gmail.com:


--
nosy: +cheeaun

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