code review
Thomas Jollans
t at jollybox.de
Mon Jul 2 10:41:49 EDT 2012
More information about the Python-list mailing list
Mon Jul 2 10:41:49 EDT 2012
- Previous message (by thread): code review
- Next message (by thread): code review
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 07/02/2012 03:28 AM, Steven D'Aprano wrote: > We *really did have* somebody arguing that chained comparisons are Bad > because you can't stick parentheses around bits of it without changing > the semantics. That was an actual argument, not a straw-man. Ahem. It may have been sub-optimally phrased in a way that opened itself up to attack, but I was arguing that Python comparisons operators are anomalous because they're not associative. (and, going back to the root of the argument, this makes them Bad because "Special cases aren't special enough to break the rules.") On Sun, 01 Jul 2012 21:50:29 -0400, Devin Jeanpierre wrote: > On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano > <steve+comp.lang.python at pearwood.info> wrote: >> Technically, < in Python is left-associative: a < b < c first evaluates >> a, not b or c. But it is left-associative under the rules of comparison >> operator chaining, not arithmetic operator chaining. > > Left-associativity is when a < b < c is equivalent to (a < b) < c.
- Previous message (by thread): code review
- Next message (by thread): code review
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list