Re: [Python-ideas] PEP 532: A circuit breaking operator and protocol

2016-11-15 Thread Nick Coghlan
On 15 November 2016 at 17:13, Ryan Fox wrote: > I'm worried that the distinction between `or` and `else` will not be > obvious. It seems like `else` will effectively just be `or`, but with more > functionality. The next draft makes that explicit: "and", "or" and PEP 505's "??" would all just be s

Re: [Python-ideas] Reverse assignment operators (=+, =-, =*, =/, =//, =**, =%)

2016-11-15 Thread Paul Moore
On 15 November 2016 at 02:59, Matthias welp wrote: > Mikhail, what Paul probably means here is that python 'operators' are actually > 'syntactic sugar' for functions (it is not recommended to call > these functions directly, but it is possible): More specifically, the meaning of the syntax a = a

[Python-ideas] How we think about change [was: Reverse assignment operators...]

2016-11-15 Thread Stephen J. Turnbull
Mikhail V writes: > But how do you jump to lists already? Because "+" and "+=" are operators which may be defined for any objects. Paul explained *why* he chose to to do that elsewhere. My point is that the semantics "a += b" *is* "type(a).__iadd__(a, b)" is true for all objects. It is a fund

Re: [Python-ideas] How we think about change [was: Reverse assignment operators...]

2016-11-15 Thread Chris Barker - NOAA Federal
> Because "+" and "+=" are operators which may be defined for any > objects. Paul explained *why* he chose to to do that elsewhere. My > point is that the semantics "a += b" *is* "type(a).__iadd__(a, b)" is > true for all objects. Well, yes. But it is defined in particular ways in the built in t

Re: [Python-ideas] Proposal: Tuple of str with w'list of words'

2016-11-15 Thread Daniel Moisset
On 12 November 2016 at 17:01, Gary Godfrey wrote: > Hi, > > This is a little more readable, but still a bit ugly. What I'm proposing > here is: > > mydf = df[ w'field1 field2 field3' ] > > This would be identical in all ways (compile-time) to: > > mydf = df[ ('field1', 'field2', 'field3') ] >

Re: [Python-ideas] How we think about change [was: Reverse assignment operators...]

2016-11-15 Thread Mikhail V
On 15 November 2016 at 14:04, Stephen J. Turnbull wrote: > > Mikhail V writes: > > But how do you jump to lists already? > Thus, in explaining this kind of thing it is often useful > (YMMV) to "jump" to a different type that supports the same behavior > to see how a proposed change can cause in

Re: [Python-ideas] How we think about change [was: Reverse assignment operators...]

2016-11-15 Thread David Mertz
The "just see it" isn't likely to go very far. My impression is that maybe 5% of people find '+=' and friends confusing or bothersome. Probably 15% are neutral (including me). And 80% think 'a += 1' is simply MORE readable and more easily understood than 'a = a+1'. Folks who come from C-family la