Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Jeffrey Yasskin
On Jan 4, 2008 8:50 AM, Guido van Rossum [EMAIL PROTECTED] wrote: On Jan 4, 2008 12:13 AM, Jeffrey Yasskin [EMAIL PROTECTED] wrote: On Jan 3, 2008 10:37 AM, Guido van Rossum [EMAIL PROTECTED] wrote: Well, as issue 1689 states, the backporting was commited by Jeffrey on rev 5967 [2], so

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-05 Thread skip
Guido What code would break if we loosened this restriction? I don't know how much, but I do know I've relied on this behavior before. (In fact, I've asked about it before.) I guess the counter question to yours would be, What would be gained by loosening this restriction? If the answer

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Guido van Rossum
On Jan 4, 2008 10:16 PM, [EMAIL PROTECTED] wrote: On 4 Jan, 10:45 pm, [EMAIL PROTECTED] wrote: [GvR to Tim] Do you have an opinion as to whether we should adopt round-to-even at all (as a default)? For the sake of other implementations (Jython, etc) and for ease of reproducing the results

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Guido van Rossum
On Jan 5, 2008 12:56 AM, Jeffrey Yasskin [EMAIL PROTECTED] wrote: On Jan 4, 2008 8:50 AM, Guido van Rossum [EMAIL PROTECTED] wrote: On Jan 4, 2008 12:13 AM, Jeffrey Yasskin [EMAIL PROTECTED] wrote: On Jan 3, 2008 10:37 AM, Guido van Rossum [EMAIL PROTECTED] wrote: Well, as issue 1689

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-05 Thread Guido van Rossum
On Jan 5, 2008 6:58 AM, [EMAIL PROTECTED] wrote: Guido What code would break if we loosened this restriction? I don't know how much, but I do know I've relied on this behavior before. (In fact, I've asked about it before.) I guess the counter question to yours would be, What would be

Re: [Python-Dev] Contributing to Python

2008-01-05 Thread A.M. Kuchling
On Fri, Jan 04, 2008 at 11:45:34PM -0800, Mike Klaas wrote: Question: should patches include edits to whatsnew.rst, or is the committer responsible for adding a note? It's OK to submit or commit patches that don't update whatsnew.rst; I'll notice the checkin and decide whether to include the

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Jeffrey Yasskin
On Jan 5, 2008 8:56 AM, Guido van Rossum [EMAIL PROTECTED] wrote: I think the consensus is against round-to-even in 3.0 -- this requires a PEP update as well as code changes. (Sorry for having caused so much extra work, I should have flagged this earlier.) I'm not convinced that speed is a

[Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Art Rasmussen
Added Python to the referenced article (because I believe Python should be seen everywhere C#, PHP, Visual Basic, etc., are seen). Please let me know if the article needs updating/fixing. http://en.wikipedia.org/wiki/Rounding --- Art Rasmussen ___

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Oleg Broytmann
On Sat, Jan 05, 2008 at 05:35:45PM -0200, Facundo Batista wrote: 2008/1/5, Art Rasmussen [EMAIL PROTECTED]: Added Python to the referenced article (because I believe Python should be seen everywhere C#, PHP, Visual Basic, etc., are seen). Please let me know if the article needs

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-05 Thread Jeffrey Yasskin
On Jan 4, 2008 12:05 PM, Tim Delaney [EMAIL PROTECTED] wrote: history of insertions and deletions. If items(), keys(), values(), iteritems(), iterkeys(), and itervalues() are called with no intervening modifications to the dictionary, the lists will directly correspond. I looked over the Java

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Facundo Batista
2008/1/5, Art Rasmussen [EMAIL PROTECTED]: Added Python to the referenced article (because I believe Python should be seen everywhere C#, PHP, Visual Basic, etc., are seen). Please let me know if the article needs updating/fixing. Well, don't know. It talks about the rounding in Python, but

[Python-Dev] Extend reST spec to allow automatic recognition of identifiers in comments?

2008-01-05 Thread Jameson Chema Quinn
This is a VERY VERY rough draft of a PEP. The idea is that there should be some formal way that reST parsers can differentiate (in docstrings) between variable/function names and identical English words, within comments. PEP: XXX Title: Catching unmarked identifiers in docstrings Version:

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread glyph
On 04:54 pm, [EMAIL PROTECTED] wrote: On Jan 4, 2008 10:16 PM, [EMAIL PROTECTED] wrote: Having other rounding methods *available*, though, would be neat. The only application I've ever worked on where I cared about the difference, the user had to select it (since accounting requirements

Re: [Python-Dev] Contributing to Python

2008-01-05 Thread Christian Heimes
Mike Klaas wrote: Question: should patches include edits to whatsnew.rst, or is the committer responsible for adding a note? A patch should contain edits for Misc/NEWS. Patches without documentation and NEWS updates costs the committer more time and reduces the likelihood of a commit. Even a

Re: [Python-Dev] Contributing to Python

2008-01-05 Thread Guido van Rossum
On Jan 5, 2008 2:36 PM, Christian Heimes [EMAIL PROTECTED] wrote: Mike Klaas wrote: Question: should patches include edits to whatsnew.rst, or is the committer responsible for adding a note? A patch should contain edits for Misc/NEWS. Patches without documentation and NEWS updates costs

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Mark Dickinson
On Jan 5, 2008 5:54 PM, [EMAIL PROTECTED] wrote: At first I didn't realize why I'd missed this feature. While the rounding *modes* are well documented, though, after 20 minutes of reading documentation I still haven't found a method or function that simply rounds a decimal to a given

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Tim Peters
[Tim] Because add a half and chop was also in wide use for even longer, is also (Wikipedia notwithstanding) part of many standards (for example, the US IRS requires it if you do your taxes under the round to whole dollars option), and-- probably the real driver --is a little cheaper to

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Tim Peters
[Mark Dickinson] quantize is about as close as it gets. Note that it's a Decimal method as well as a Context method, so you can invoke it directly on a given decimal: Decimal(2.34567).quantize(Decimal(0.01)) Decimal(2.35) This reads better in many cases if you define a constant first,

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Daniel Stutzbach
On Jan 4, 2008 1:31 PM, Tim Peters [EMAIL PROTECTED] wrote: Curiously, round-to-nearest can be unboundedly more expensive to implement in some obscure contexts when floats can have very large exponents (as they can in Python's decimal module -- this is why the proposed decimal standard allows

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Aahz
On Sat, Jan 05, 2008, [EMAIL PROTECTED] wrote: At first I didn't realize why I'd missed this feature. While the rounding *modes* are well documented, though, after 20 minutes of reading documentation I still haven't found a method or function that simply rounds a decimal to a given

[Python-Dev] Rounding Decimals

2008-01-05 Thread Jeffrey Yasskin
On Jan 5, 2008 3:34 PM, Mark Dickinson [EMAIL PROTECTED] wrote: On Jan 5, 2008 5:54 PM, [EMAIL PROTECTED] wrote: At first I didn't realize why I'd missed this feature. While the rounding *modes* are well documented, though, after 20 minutes of reading documentation I still haven't found

Re: [Python-Dev] Rounding Decimals

2008-01-05 Thread Raymond Hettinger
I think pep 3141's round(x, ndigits) does (1). The only thing it doesn't support yet is specifying the rounding mode. Perhaps the pep should say that round() passes any extra named arguments on to the __round__() method so that users can specify a rounding mode for types that support it?

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Tim Peters
[Tim] Curiously, round-to-nearest can be unboundedly more expensive to implement in some obscure contexts when floats can have very large exponents (as they can in Python's decimal module -- this is why the proposed decimal standard allows operations like remainder-near to fail if applied to

Re: [Python-Dev] Return type of round, floor, and ceil in 2.6

2008-01-05 Thread Raymond Hettinger
[Tim] I agree it's far from obvious to most how to accomplish rounding using the decimal facilities. FWIW, there is an entry for this in the Decimal FAQ: http://docs.python.org/lib/decimal-faq.html Raymond ___ Python-Dev mailing list