[issue5534] Decimal __format__ reverses meaning of '<' and '>' alignment specs

2009-03-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> marketdickinson nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mail

[issue5534] Decimal __format__ reverses meaning of '<' and '>' alignment specs

2009-03-21 Thread Donald O'Donnell
New submission from Donald O'Donnell : decimal.py ver 2.6: line 5474 is "if align == '<':" s/b "if align == '>':" line 5476 is "if align == '>':" s/b "if align == '<':" decimal.py ver 3.01: line 5578 is "if align == '<':" s/b "if align == '>':" line 5580 is "if align == '>'

[issue5381] json needs object_pairs_hook

2009-03-21 Thread Lim Chee Aun
Changes by Lim Chee Aun : -- nosy: +cheeaun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson
Tim Cuthbertson 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

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Brett. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Brett Cannon
Brett Cannon 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

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

2009-03-21 Thread Luca clementi
Luca clementi added the comment: I forgot to say that the \n should be substitute with \r\n CRLF Luca -- ___ Python tracker ___ ___

[issue5512] Streamline integer division

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll look at this more later today. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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 _

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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 fract

[issue5532] imap usage in itertools unique_justseen recipe

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Benjamin, please revert r69354 which was an incorrect merge. -- assignee: rhettinger -> benjamin.peterson nosy: +benjamin.peterson ___ Python tracker ___

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: marketdickinson -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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

[issue5532] imap usage in itertools unique_justseen recipe

2009-03-21 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: georg.brandl -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list ma

[issue5533] unittest can't deal with packages

2009-03-21 Thread Aristotelis Mikropoulos
Aristotelis Mikropoulos added the comment: You are right, here is the file. -- Added file: http://bugs.python.org/file13390/test ___ Python tracker ___ __

[issue5533] unittest can't deal with packages

2009-03-21 Thread Jean-Paul Calderone
Jean-Paul Calderone 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

[issue5533] unittest can't deal with packages

2009-03-21 Thread Aristotelis Mikropoulos
New submission from Aristotelis Mikropoulos : 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 typ

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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 a

[issue5532] imap usage in itertools unique_justseen recipe

2009-03-21 Thread Michael Newman
New submission from Michael Newman : 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

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger 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

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson
Mark Dickinson added the comment: What about Decimal <-> Fraction comparisons? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger 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 orde

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger 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.

[issue1296434] Call by object reference sometimes call by value

2009-03-21 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> works for me status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue1296434] Call by object reference sometimes call by value

2009-03-21 Thread Alan G
Alan G added the comment: Lol! After four years I could hardly claim to care anymore... -- ___ Python tracker ___ ___ Python-bugs-

[issue1492860] Integer bit operations performance improvement.

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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.

[issue1492860] Integer bit operations performance improvement.

2009-03-21 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue2706] datetime: define division timedelta/timedelta

2009-03-21 Thread webograph
webograph 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

[issue2531] float compared to decimal is silently incorrect.

2009-03-21 Thread Mark Dickinson
Mark Dickinson added the comment: > My complaint is that it is silently wrong. I appreciate that, but I don't see any good solution. Yes, it would be nice if float <-> Decimal comparisons raised TypeError in 2.x. But Python 2.x has an '(almost) everything is comparable to everything else'

[issue1503789] Cannot write source code in UTF16

2009-03-21 Thread STINNER Victor
STINNER Victor 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. -- ___ P

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

2009-03-21 Thread STINNER Victor
STINNER Victor 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 tracke

[issue5524] execfile() removed from Python3

2009-03-21 Thread STINNER Victor
STINNER Victor 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 meaningl

[issue5463] Remove deprecated features from struct module

2009-03-21 Thread Mark Dickinson
Mark Dickinson 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 i

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson
Tim Cuthbertson 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-o

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

2009-03-21 Thread kxroberto
kxroberto 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 +010

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

2009-03-21 Thread kxroberto
Changes by kxroberto : -- title: compute/doc %z os-indep., time.asctime_tz / _TZ -> time.asctime_tz, time.strftime %z %C ___ Python tracker ___ ___

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

2009-03-21 Thread kxroberto
kxroberto 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 sho

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson
New submission from Tim Cuthbertson : 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 circums

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

2009-03-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg 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

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

2009-03-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg 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 impleme

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

2009-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: Reclassifying as a documentation bug, since PEP 377 was rejected by Guido. -- components: +Documentation -None ___ Python tracker ___

[issue4735] An error occurred during the installation of assembly

2009-03-21 Thread Martin v. Löwis
Martin v. Löwis added the comment: Can you please run the Python installer with msiexec /i python.msi /l*v python.log and compress and attach the resulting log file? -- nosy: +loewis ___ Python tracker _

[issue4911] Windows installer Quad processor issues

2009-03-21 Thread Martin v. Löwis
Martin v. Löwis added the comment: Can you please run the Python installer with msiexec /i python.msi /l*v python.log and compress and attach the resulting log file? -- nosy: +loewis ___ Python tracker _