[issue1600] str.format() produces different output on different platforms (Py30a2)

2008-02-18 Thread Mark Summerfield
Mark Summerfield added the comment: On 2008-02-18, Mark Dickinson wrote: > Mark Dickinson added the comment: > > I know I'm coming a bit late to this discussion, but I wanted to point > out that the C99 standard does actually specify how many digits should > be in the exponent of a "%e"-formatted

[issue2138] Factorial

2008-02-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I wouldn't worry about that so much -- our job is to provide good primitives. __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1945] Document back ported C functions

2008-02-18 Thread John Lenton
John Lenton added the comment: This is the same as the previous patch, but I added the "versionadded" notation in the rst, and the info in refcounts.dat to get the "return value" info in the docs. Added file: http://bugs.python.org/file9461/1945-2.diff __ Tracker

[issue2138] Factorial

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: The other issue here is that I see factorial as being the thin end of the wedge. If factorial were implemented, it would probably only be on the order of minutes before people wanted to know where the binomial() function was. So it seems to me that either t

[issue2138] Factorial

2008-02-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: gcd() is probably fine where it is. People learn about GCD and LCM where they first learn fractions. So, there is a strong association. __ Tracker <[EMAIL PROTECTED]> __

[issue2138] Factorial

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: > Since the domain and range are ints/longs, this makes more sense as a > method on than as a math module function. Fair enough. Raymond, do you have any thoughts on where a gcd implementation might most usefully live? Should it stay in fractions.py, or is

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

2008-02-18 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: 1) No worries. Even without inlining the common case of __add__, etc., Fraction is now faster than Decimal for smallish fractions [sum(Fraction(1, i) for i in range(1, 100))], and for large ones [sum(Fraction(1, i) for i in range(1, 1000))] gcd takes so much of

[issue2138] Factorial

2008-02-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Since the domain and range are ints/longs, this makes more sense as a method on than as a math module function. The other math module functions mostly have real valued inputs and mostly have counterparts in cmath. IIRC, Tim wanted the math module to ma

[issue1600] str.format() produces different output on different platforms (Py30a2)

2008-02-18 Thread Eric Smith
Eric Smith added the comment: Given Mark Dickinson's input, I think we should follow it. That effectively means leaving the Linux/MacOS input as is, and modifying the Windows output. I'll work up a patch, but I'd still like to get some input on changing the output of existing, working code. __

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

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: Two things: (1) Speedup. I haven't been helping much here; apologies. Christian suggested that a C implementation of gcd might help. Is this true, or are we not yet at the stage where the gcd calls are significant? There are some basic tricks that can sp

[issue2137] test_crasher in test_struct uses 8 GB memory on 64 bit systems

2008-02-18 Thread Ralf Schmitt
Ralf Schmitt added the comment: I didn't check the trunk version - I just assumed it would also be there. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bu

[issue1856] shutdown (exit) can hang or segfault with daemon threads running

2008-02-18 Thread Kurt B. Kaiser
Changes by Kurt B. Kaiser: -- nosy: +kbk __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue2142] naive use of ''.join(difflib.unified_diff(...)) results in bogus diffs with inputs that don't end with end-of-line char

2008-02-18 Thread Trent Mick
Trent Mick added the comment: At a glance I suspect this patch will work back to Python 2.3 (when difflib.unified_diff() was added). I haven't looked at the Py3k tree yet. Note: This *may* also applied to difflib.context_diff(), but I am not sure. __ Tracker <[E

[issue2142] naive use of ''.join(difflib.unified_diff(...)) results in bogus diffs with inputs that don't end with end-of-line char

2008-02-18 Thread Trent Mick
Trent Mick added the comment: Attached is a patch against the Python 2.6 svn trunk for this. -- versions: +Python 2.3, Python 2.4, Python 2.6 Added file: http://bugs.python.org/file9460/python_difflib_unified_diff.patch __ Tracker <[EMAIL PROTECTED]>

[issue2142] naive use of ''.join(difflib.unified_diff(...)) results in bogus diffs with inputs that don't end with end-of-line char

2008-02-18 Thread Trent Mick
New submission from Trent Mick: When comparing content with difflib, if the resulting diff covers the last line of one or both of the inputs that that line doesn't end with an end-of-line character(s), then the generated diff lines don't include an EOL. Fair enough. Naive (and I suspect typical)

[issue1600] str.format() produces different output on different platforms (Py30a2)

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: I know I'm coming a bit late to this discussion, but I wanted to point out that the C99 standard does actually specify how many digits should be in the exponent of a "%e"-formatted number: In section 7.19.6, in the documentation for fprintf, it says: "The expon

[issue2138] Factorial

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: > Should there be some upper limit on the argument math.factorial would take? I'd say not. Any such limit would be artificial, and an arbitrary choice. Just let the natural time and space requirements be the limiting factor. __

[issue2139] sqlite3 module needs upgrading

2008-02-18 Thread Martin v. Löwis
Martin v. Löwis added the comment: Such bugs should have been reported here much earlier. Blind upgrading to the latest version is no option, as the latest version may also introduce new features, which is unacceptable for a bugfix release. Specific bugs could have been fixed, but really not now

[issue2138] Factorial

2008-02-18 Thread Alan McIntyre
Alan McIntyre added the comment: >Except that hypot is not a one-liner, if you want to get edge cases right. Ah, true; thanks for pointing that out. Should there be some upper limit on the argument math.factorial would take? At the moment I can't think of any reason for picking a given limit,

[issue2137] test_crasher in test_struct uses 8 GB memory on 64 bit systems

2008-02-18 Thread Martin v. Löwis
Martin v. Löwis added the comment: Thanks for the report. I have removed the test in r60892. Not sure why you've marked it as Py2.6 also; this code has not been merged into the trunk yet. -- resolution: -> fixed status: open -> closed versions: -Python 2.6 ___

[issue1739842] xmlrpclib can no longer marshal Fault objects

2008-02-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Trying to understand the real problem: Exceptions are not correctly marshalled by xmlrpclib, even with 2.6. Take a standard exception, and process it: e = KeyError("message") ((d,), _) = xmlrpclib.loads(xmlrpclib.dumps((e,))) With python2.4: you ge

[issue2138] Factorial

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: > Yeah, it's a one-liner, but so is hypot Except that hypot is not a one-liner, if you want to get edge cases right. (Consider hypot(1e200, 1e200), or hypot(1e-200, 1e-200).) __ Tracker <[EMAIL PROTECTED]>

[issue2138] Factorial

2008-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: I don't think it would be appropriate to add this as a method of int; it seems like unnecessary clutter on a core type. Perhaps a math.factorial function could be considered? Historically, the math module has just been a way to wrap the (mostly floating-point)

[issue2138] Factorial

2008-02-18 Thread Alan McIntyre
Alan McIntyre added the comment: It seems like most of the methods on integers are for two-argument operations (add, mul, div, etc.), while a lot of single-argument operations are in the math module. If this gets added would it fit better as a function in the math module? I have to say a factor

[issue1739842] xmlrpclib can no longer marshal Fault objects

2008-02-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps the backported version should only care about instances of the Fault class? _ Tracker <[EMAIL PROTECTED]> _

[issue1739842] xmlrpclib can no longer marshal Fault objects

2008-02-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: description for rev 52790 is: """ Patch #1070046: Marshal new-style objects like InstanceType in xmlrpclib. """ This _change_ is a new feature. OTOH it corrects a real regression. Other thoughts? _ Tracker <[EMAIL PROTE

[issue1739842] xmlrpclib can no longer marshal Fault objects

2008-02-18 Thread Mike Bonnet
Mike Bonnet added the comment: How can this be considered a new feature? Code that worked under python2.4 fails under python2.5 as a result of this bug. That is clearly a regression. I think that qualifies it for a backport to python2.5. _ Tracker <[EMAIL P

[issue2141] Pydoc interactive browser misses some docs

2008-02-18 Thread moreilcon
New submission from moreilcon: #no mention about formatdate at all: % pydoc rfc822 | grep formatdate | wc -l 0 # but rfc822.formatdate docstring exists: % pydoc rfc822.formatdate | wc -l 12 # also same behavior : % pydoc codecs | getwriter | wc -l 0 Reproduced at: Python 2.5.1 (r251:54863, Jan 1

[issue1739842] xmlrpclib can no longer marshal Fault objects

2008-02-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Seems fixed indeed. Tested the following script: import xmlrpclib e = xmlrpclib.Fault("Error", "Message") ((d,), _) = xmlrpclib.loads(xmlrpclib.dumps((e,))) assert d['faultString'] == "Message" which works with python2.4, fails with python2.5, and works a

[issue1739842] xmlrpclib can no longer marshal Fault objects

2008-02-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: It looks like this was fixed in the trunk by rev 52790. Can someone check it is indeed the case? -- nosy: +loewis, pitrou _ Tracker <[EMAIL PROTECTED]> ___

[issue2134] function generate_tokens at tokenize.py yields wrong token for colon

2008-02-18 Thread Guilherme Polo
Guilherme Polo added the comment: I'm attaching a patch that solves this and updates tests. Added file: http://bugs.python.org/file9459/tokenize_r60884.diff __ Tracker <[EMAIL PROTECTED]> __ _

[issue2140] calculation bug in long() function

2008-02-18 Thread Markus Stoll
Markus Stoll added the comment: thank you for fast reply I see the point and do not want to argue about that (rounding is fine for me). I just think this behaviour makes the long() function pretty much useless. Regards, Markus Am 18.02.2008 um 13:25 schrieb Facundo Batista: > > Facundo Bat

[issue1224] SimpleHTTPServer doesn't understand // at beginning of path anymore

2008-02-18 Thread Facundo Batista
Facundo Batista added the comment: Fixed in r60885. Thanks everybody! -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __

[issue2140] calculation bug in long() function

2008-02-18 Thread Facundo Batista
Facundo Batista added the comment: In short: >>> long(100 * 146.95) 14694L This is NOT a bug, but a behaviour of binary floating point: >>> 146.95 146.94 In binary you can not express this number exactly. >>> 146.95 * 100 14694.9998 When you long() that, you truncate th

[issue2140] calculation bug in long() function

2008-02-18 Thread Markus Stoll
New submission from Markus Stoll: betrag = 146.95 betrag = float(betrag) betrag = betrag * 100.0 betrag = long(betrag) print betrag gives 14694 as result rather than 14695 __ Tracker <[EMAIL PROTECTED]> _

[issue2140] calculation bug in long() function

2008-02-18 Thread Markus Stoll
Changes by Markus Stoll: -- components: None nosy: must21 severity: normal status: open title: calculation bug in long() function type: behavior versions: Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, Python 2.2.2, Python 2.2.3, Python 2.3, Python 2.4, Python 2.5 __

[issue1518] Fast globals/builtins access (patch)

2008-02-18 Thread Gabriel Genellina
Changes by Gabriel Genellina: -- nosy: +gagenellina __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue1742669] "%d" format handling for long values

2008-02-18 Thread Gabriel Genellina
Gabriel Genellina added the comment: An updated patch, along the lines given by Travis Oliphant. Added file: http://bugs.python.org/file9458/floatfmt.diff _ Tracker <[EMAIL PROTECTED]>

[issue2139] sqlite3 module needs upgrading

2008-02-18 Thread carlo verr
New submission from carlo verr: In Python 2.5.2.c1 the sqlite3 module contains (exactly as Python 2.5.1 does) PySQLite 2.3.2 with SQLite 3.3.4, which is very old and very buggy, it hungs randomly. Last available version of SQLite is 3.5.6. Last available version of PySQLite for Python 2.5 is 2.4

[issue2138] Factorial

2008-02-18 Thread David Albert Torpey
New submission from David Albert Torpey: Add a factorial method. Everybody understands what it means before they are out of high school and it comes up all the time in statistics and combinatorics. Ruby has a factorial method and heck even basic calculators have a factorial key. print n.fac

[issue2137] test_crasher in test_struct uses 8 GB memory on 64 bit systems

2008-02-18 Thread Ralf Schmitt
Changes by Ralf Schmitt: -- components: +Tests type: -> resource usage __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Uns

[issue2137] test_crasher in test_struct uses 8 GB memory on 64 bit systems

2008-02-18 Thread Ralf Schmitt
New submission from Ralf Schmitt: I think this should be disabled on 64 bit systems. It makes running regrtest.py for me basically impossible. Martin, I've put you on the nosy list, as you have committed this one in revision 60793. -- files: test_crasher_only_on_32bit.txt messages: 62519