Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Greg Ewing
Steven D'Aprano wrote: If I do x = 0.0/0 I get an exception instead of a NAN. But the exception you get is ZeroDivisionError, so I think Python is catching this before you get to the stage of producing a NaN. -- Greg ___ Python-Dev mailing list Pyth

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Robert Kern
On Fri, Apr 29, 2011 at 11:35, Alexander Belopolsky wrote: > On Fri, Apr 29, 2011 at 11:31 AM, Robert Kern wrote: > .. >> And in fact, 0.0/0.0 is covered by the more general rule that x/0.0 raises >> ZeroDivisionError, not a rule that converts IEEE-754 INVALID exceptions into >> Python exceptions

Re: [Python-Dev] python and super

2011-04-29 Thread Ethan Furman
Ricardo Kirkner wrote: I'll give you the example I came upon: I have a TestCase class, which inherits from both Django's TestCase and from some custom TestCases that act as mixin classes. So I have something like class MyTestCase(TestCase, Mixin1, Mixin2): ... now django's TestCase class in

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Vinay Sajip
Terry Reedy udel.edu> writes: > > http://coverage.livinglogic.de/ > > which, however, currently has nothing for *.py. > Perhaps a glitch/bug, as there used to be such. > Anyone who knows the page owner might ask about this. > Thanks for the pointer, nevertheless, Terry. Regards, Vinay Sajip

[Python-Dev] Fwd: viewVC shows traceback on non utf-8 module markup

2011-04-29 Thread Michael Foord
I know that the svn repo is now for legacy purposes only, but I doubt it is intended that the online source browser should raise exceptions. (See report below.) All the best, Michael Original Message Subject:viewVC shows traceback on non utf-8 module markup Date: T

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Terry Reedy
On 4/29/2011 3:11 PM, Terry Reedy wrote: On 4/29/2011 12:09 PM, Vinay Sajip wrote: BTW, is there a public place somewhere showing stdlib coverage statistics? I looked on the buildbot pages as the likeliest home for them, but perhaps I missed them. http://docs.python.org/devguide/coverage.html

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Terry Reedy
On 4/29/2011 12:09 PM, Vinay Sajip wrote: BTW, is there a public place somewhere showing stdlib coverage statistics? I looked on the buildbot pages as the likeliest home for them, but perhaps I missed them. http://docs.python.org/devguide/coverage.html has a link to http://coverage.livinglogic

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Alexander Belopolsky
On Fri, Apr 29, 2011 at 1:11 PM, Guido van Rossum wrote: > … Would it make sense to add > a float context that also lets one specify what should happen? That > could include returning Inf for 1.0/0.0 (for experts), or raising > exceptions when NaNs are produced (for the numerically naive like > my

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Guido van Rossum
On Fri, Apr 29, 2011 at 12:10 AM, Stephen J. Turnbull wrote: > Other aspects of NaN behavior may be a mistake.  But it's not clear to > me, even after all the discussion in this thread. ISTM that the current behavior of NaN (never mind the identity issue) helps numeric experts write better code.

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Alexander Belopolsky
On Fri, Apr 29, 2011 at 11:31 AM, Robert Kern wrote: .. > And in fact, 0.0/0.0 is covered by the more general rule that x/0.0 raises > ZeroDivisionError, not a rule that converts IEEE-754 INVALID exceptions into > Python exceptions. It is unfortunate that official text of IEEE-754 is not freely a

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Vinay Sajip
[Georg] > > BTW, didn't we agree not to put "pragma" comments into the stdlib code? I'd be grateful for a link to the prior discussion - it must have passed me by originally, and I searched python-dev on gmane but couldn't find any threads about this. [Nick] > I think some folks objected, but si

[Python-Dev] Summary of Python tracker Issues

2011-04-29 Thread Python tracker
ACTIVITY SUMMARY (2011-04-22 - 2011-04-29) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open2760 ( +8) closed 20976 (+39) total 23736 (+47) Open issues wit

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Robert Kern
On 4/29/11 1:35 AM, Nick Coghlan wrote: On Fri, Apr 29, 2011 at 3:28 PM, Steven D'Aprano wrote: Robert Kern wrote: Actually, Python treats all NaNs as quiet NaNs and never signalling NaNs. Sorry, did I get that backwards? I thought it was signalling NANs that cause a signal (in Python terms,

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
>   You can implement this in your own subclass of dict, no? Yes, I just thought it would be convenient to have in the language itself, but the responses to my post seem to indicate that [not returning the updated object] is an intended language feature for mutable types like dict or list. class

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
2011/4/29 R. David Murray : > 2011/4/29 Roy Hyunjin Han : >> It would be convenient if replacing items in a dictionary returns the >> new dictionary, in a manner analogous to str.replace() > > This belongs on python-ideas, but the short answer is no.  The > general language design principle (as I u

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Oleg Broytman
Hi! Seems like a question for python-ideas mailing list, not for python-dev. On Fri, Apr 29, 2011 at 10:27:46AM -0400, Roy Hyunjin Han wrote: > It would be convenient if replacing items in a dictionary returns the > new dictionary, in a manner analogous to str.replace(). What do you > think? > ::

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread R. David Murray
On Fri, 29 Apr 2011 10:27:46 -0400, Roy Hyunjin Han wrote: > It would be convenient if replacing items in a dictionary returns the > new dictionary, in a manner analogous to str.replace(). What do you > think? This belongs on python-ideas, but the short answer is no. The general language desig

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Mark Shannon
Roy Hyunjin Han wrote: It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace(). What do you think? :: # Current behavior x = {'key1': 1} x.update(key1=3) == None x == {'key1': 3} # Original variable has change

[Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace(). What do you think? :: # Current behavior x = {'key1': 1} x.update(key1=3) == None x == {'key1': 3} # Original variable has changed # Possible behavior

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Ben Finney
Steven D'Aprano writes: > I'm sorry for my lack of clarity. I'm referring to functions which > potentially produce NANs, not the exceptions themselves. A calculation > which might have produced a (quiet) NAN as the result instead raises > an exception (which I'm treating as equivalent to a signal

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Antoine Pitrou
On Fri, 29 Apr 2011 14:29:46 +0200 DasIch wrote: > Given those facts I think including pybench is a mistake. It does not > allow for a fair or meaningful comparison between implementations > which is one of the things the suite is supposed to be used for in the > future. "Including" is quite vagu

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread M.-A. Lemburg
DasIch wrote: > Given those facts I think including pybench is a mistake. It does not > allow for a fair or meaningful comparison between implementations > which is one of the things the suite is supposed to be used for in the > future. > > This easily leads to misinterpretation of the results fro

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread DasIch
Given those facts I think including pybench is a mistake. It does not allow for a fair or meaningful comparison between implementations which is one of the things the suite is supposed to be used for in the future. This easily leads to misinterpretation of the results from this particular benchmar

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Nick Coghlan
On Fri, Apr 29, 2011 at 9:44 PM, Georg Brandl wrote: > On 27.04.2011 23:23, Vinay Sajip wrote: >> I've been recently trying to improve the test coverage for the logging >> package, >> and have got to a not unreasonable point: >> >> logging/__init__.py 99% (96%) >> logging/config.py 89% (85%) >> l

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Georg Brandl
On 27.04.2011 23:23, Vinay Sajip wrote: > I've been recently trying to improve the test coverage for the logging > package, > and have got to a not unreasonable point: > > logging/__init__.py 99% (96%) > logging/config.py 89% (85%) > logging/handlers.py 60% (54%) > > where the figures in parenth

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-29 Thread Floris Bruynooghe
On 28 April 2011 23:07, Guido van Rossum wrote: > On Thu, Apr 28, 2011 at 2:53 PM, Raymond Hettinger > wrote: >> >> On Apr 28, 2011, at 1:27 PM, Holger Krekel wrote: >> >>> On Thu, Apr 28, 2011 at 6:59 PM, Guido van Rossum wrote: On Thu, Apr 28, 2011 at 12:54 AM, Tarek Ziadé wrote: >

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Michael Foord
On 29/04/2011 11:04, M.-A. Lemburg wrote: Mark Shannon wrote: Maciej Fijalkowski wrote: On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnel wrote: M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in t

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread M.-A. Lemburg
Mark Shannon wrote: > Maciej Fijalkowski wrote: >> On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnel >> wrote: >>> M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: > DasIch, 28.04.2011 20:55: >> the CPython >> benchmarks have an extensive set of microbenchmarks in the pybench >

Re: [Python-Dev] [Python-checkins] cpython (2.7): Fix closes issue10761: tarfile.extractall failure when symlinked files are

2011-04-29 Thread Nadeem Vawda
On Fri, Apr 29, 2011 at 10:02 AM, Eli Bendersky wrote: > I completely understand this "other code/thread deletes the path > between exists() and unlink()" case - it indeed is a race condition > waiting to happen. What I didn't understand was Antoine's example of > "attacker creates targetpath betw

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Mark Shannon
Maciej Fijalkowski wrote: On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnel wrote: M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in the pybench package Try not to care too much about pybench. The

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-29 Thread Maciej Fijalkowski
On Fri, Apr 29, 2011 at 9:55 AM, Holger Krekel wrote: > On Fri, Apr 29, 2011 at 12:31 AM, Raymond Hettinger > wrote: >> >> On Apr 28, 2011, at 3:07 PM, Guido van Rossum wrote: >> >>> On Thu, Apr 28, 2011 at 2:53 PM, Raymond Hettinger >>> wrote: On Apr 28, 2011, at 1:27 PM, Holger Kreke

Re: [Python-Dev] [Python-checkins] cpython (2.7): Fix closes issue10761: tarfile.extractall failure when symlinked files are

2011-04-29 Thread Eli Bendersky
On Fri, Apr 29, 2011 at 09:52, Nick Coghlan wrote: > On Fri, Apr 29, 2011 at 4:26 PM, Eli Bendersky wrote: On Thu, Apr 28, 2011 at 04:20:06PM +0200, Éric Araujo wrote: >>> The kind of race condition which can happen here is if an attacker >>> creates "targetpath" between os.path.exists and o

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-29 Thread Holger Krekel
On Fri, Apr 29, 2011 at 12:31 AM, Raymond Hettinger wrote: > > On Apr 28, 2011, at 3:07 PM, Guido van Rossum wrote: > >> On Thu, Apr 28, 2011 at 2:53 PM, Raymond Hettinger >> wrote: >>> >>> On Apr 28, 2011, at 1:27 PM, Holger Krekel wrote: >>> On Thu, Apr 28, 2011 at 6:59 PM, Guido van Rossu

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Stephen J. Turnbull
Terry Reedy writes: > > Python treats it as if it were a number: > > As I said, so did the committee, and that was its mistake that we are > more or less stuck with. The committee didn't really have a choice. You could ask that they call NaNs something else, but some bit pattern is going t