Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Giovanni Bajo
On 19/05/2007 3.21, Guido van Rossum wrote: >>> While reviewing PEPs, I stumbled over PEP 335 ( Overloadable Boolean >>> Operators) by Greg Ewing. >>> >>> It is time to reject it due to lack of interest, or revive it! >> Didn't you post something about this a short time ago, >> suggesting you were

Re: [Python-3000] PEP 3131 - the details

2007-05-19 Thread Nick Coghlan
Jim Jewett wrote: > On the other hand, I'm not sure how often users of non-latin languages > will want to mix in latin letters. The tech report suggested that it > is fairly common to use all of (Hiragana | Katakana | Han | Latin) in > Japanese text, but I'm not sure whether it would be normal to

Re: [Python-3000] [Python-Dev] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Jason Orendorff
On 5/18/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > While reviewing PEPs, I stumbled over PEP 335 ( Overloadable Boolean > Operators) by Greg Ewing. -1. "and" and "or" affect the flow of control. It's a matter of taste, but I feel the benefit is too small here to add another flow-control q

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Neil Toronto
Giovanni Bajo wrote: > On 19/05/2007 3.21, Guido van Rossum wrote: > While reviewing PEPs, I stumbled over PEP 335 ( Overloadable Boolean Operators) by Greg Ewing. It is time to reject it due to lack of interest, or revive it! >>> Didn't you post something about

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Giovanni Bajo
On 19/05/2007 19.12, Neil Toronto wrote: > There's a fairly common one, actually, that comes up quite a lot in > Numpy. Currently, best practice is a wart. Here's some code of mine for > evaluating log probabilities from the Multinomial family: > > class Multinomial(DistFamily): > @

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Robert Kern
Giovanni Bajo wrote: > Another workaround could be: > > return scipy.where( > "xsum != n or psum < 0.9 or " > "psum > 1.01 or not scipy.isfinite(result)", > -scipy.inf, result) > > with the necessary magic to pull out variables from the stack frame. Parsing > could be done

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Raymond Hettinger
> Giovanni Bajo wrote: >> Another workaround could be: Before focusing mental talents on workarounds and implementations, it would be worthwhile to consider whether the idea would help or hurt the language. The and/or keywords already have some complexity due to their returning non-boolean values

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Bob Ippolito
On 5/19/07, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > Giovanni Bajo wrote: > >> Another workaround could be: > > Before focusing mental talents on workarounds and implementations, > it would be worthwhile to consider whether the idea would help or > hurt the language. The and/or keywords al

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Robert Kern
Raymond Hettinger wrote: >> Giovanni Bajo wrote: >>> Another workaround could be: > > Before focusing mental talents on workarounds and implementations, > it would be worthwhile to consider whether the idea would help or > hurt the language. The and/or keywords already have some complexity > due

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Greg Ewing
Raymond Hettinger wrote: > Someone once proposed overloadable behavior for the "is" operator. > IMO, the reasons for rejecting that idea also apply to this proposal. The reason for rejecting that is that it would leave us with no way of reliably testing whether two references point to the same obj

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Greg Ewing
Raymond Hettinger wrote: > FWIW, the peephole optimizer takes advantage of the current meaning > of and/or to generate faster code. Can you give some examples of the sort of optimisations that are done? It may still be possible to do them -- the AND1 and OR1 bytecodes in my proposal are condition

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Greg Ewing
Bob Ippolito wrote: > Would "and" and "or" still be able to properly short-circuit given > this proposal? Yes. I was very careful to ensure that all the existing semantics are preserved in the case of no overloads, and also that overloads can mimic all of the existing semantics if they need to.

Re: [Python-3000] Radical idea: remove built-in open (requireimport io)

2007-05-19 Thread Raymond Hettinger
From: "Andrew Koenig" <[EMAIL PROTECTED]> > (I'm feeling slightly pedantic today, so I want to say that the proposal > doesn't make it any easier to identify modules that engage in I/O -- it > makes it easier to identify modules that assuredly do not engage in I/O. u = urllib.urlopen('http://www.p

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Jason Orendorff
On 5/19/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Raymond Hettinger wrote: > > FWIW, the peephole optimizer takes advantage of the current meaning > > of and/or to generate faster code. > > Can you give some examples of the sort of optimisations > that are done? Look in Python/peephole.c, functi

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Greg Ewing
Jason Orendorff wrote: > Look in Python/peephole.c, Which version of Python is this in? I can't find a file by that name anywhere in my 2.3, 2.4.3 or 2.5 sources. -- Greg ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman

Re: [Python-3000] Wither PEP 335 (Overloadable Boolean Operators)?

2007-05-19 Thread Steven Bethard
On 5/19/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Jason Orendorff wrote: > > Look in Python/peephole.c, > > Which version of Python is this in? I can't find a file by > that name anywhere in my 2.3, 2.4.3 or 2.5 sources. http://svn.python.org/view/python/trunk/Python/peephole.c?rev=54086&view=ma

Re: [Python-3000] PEP 367: New Super

2007-05-19 Thread Tim Delaney
Phillip J. Eby wrote: > At 05:23 PM 5/14/2007 +1000, Tim Delaney wrote: >> Determining the class object to use >> ''' >> >> The exact mechanism for associating the method with the defining >> class is not >> specified in this PEP, and should be chosen for maximum per

Re: [Python-3000] PEP 367: New Super

2007-05-19 Thread Tim Delaney
Tim Delaney wrote: > Phillip J. Eby wrote: >> At 05:23 PM 5/14/2007 +1000, Tim Delaney wrote: >>> Determining the class object to use >>> ''' >>> >>> The exact mechanism for associating the method with the defining >>> class is not >>> specified in this PEP, and shou