Re: [Python-Dev] PEP 8 update

2015-04-06 Thread Steven D'Aprano
On Tue, Apr 07, 2015 at 03:11:30AM +0100, Rob Cliffe wrote: > As a matter of interest, how far away from mainstream am I in > preferring, *in this particular example* (obviously it might be > different for more complicated computation), > > def foo(x): > return math.sqrt(x) if x >=

Re: [Python-Dev] PEP 8 update

2015-04-06 Thread Rob Cliffe
On 07/04/2015 02:08, Guido van Rossum wrote: I've taken the liberty of adding the following old but good rule to PEP 8 (I was surprised to find it wasn't already there since I've lived by this for ages): * Be consistent in return statements. Either all return statements in a functi

Re: [Python-Dev] PEP 8 update

2015-04-06 Thread Barry Warsaw
On Apr 06, 2015, at 06:08 PM, Guido van Rossum wrote: >I've taken the liberty of adding the following old but good rule to PEP 8 >(I was surprised to find it wasn't already there since I've lived by this >for ages): > > Be consistent in return statements. Either all return statements in a > fu

[Python-Dev] PEP 8 update

2015-04-06 Thread Guido van Rossum
I've taken the liberty of adding the following old but good rule to PEP 8 (I was surprised to find it wasn't already there since I've lived by this for ages): - Be consistent in return statements. Either all return statements in a function should return an expression, or none of them sh

Re: [Python-Dev] PEP 487 vs 422 (dynamic class decoration)

2015-04-06 Thread Eric Snow
On Fri, Apr 3, 2015 at 6:44 AM, Martin Teichmann wrote: > Nick, I couldn't agree more with you, yet I think PJ actually brought > up a very interesting point. Post-processing is a very common thing > these days, and has been re-written so many times that I think it is > about time that something l

Re: [Python-Dev] PEP 487 vs 422 (dynamic class decoration)

2015-04-06 Thread Eric Snow
On Sat, Apr 4, 2015 at 6:40 PM, Greg Ewing wrote: > Eric Snow wrote: >> >> I've felt for a long time that it would be helpful in some situations >> to have a reverse descriptor protocol. > > Can you elaborate on what you mean by that? Sure. It's more python-ideas territory (I posted about it a f