True == 1 weirdness

Random832 random832 at fastmail.com
Wed Sep 16 22:55:07 CEST 2015


On Wed, Sep 16, 2015, at 16:38, Mark Lawrence wrote:
> On 16/09/2015 18:41, Sven R. Kunze wrote:
> > On 16.09.2015 19:33, Steven D'Aprano wrote:
> >> And with operator overloading, < <=  > and => could have any meaning you
> >> like:
> >>
> >> graph = a => b => c <= d <= e
> >
> > Sorry? What are you trying to do here?
> 
> Typo I'd hazard a guess at, should be graph = a >= b >= c <= d <= e
> 
> Assuming that I'm correct, graph is True if a is greater than or equal 
> to b and b is greater than equal to c and c is less than or equal to d 
> and d is less than or equal to e else False.  So where is the problem?

Except in context, he was suggesting that they have a meaning other than
"greater than or equal" and "less than or equal". (see "could have any
meaning you like"). It seemed implied that he was suggesting there was
some arrangement of operator overloads that could cause this statement
to generate a directed graph with the structure shown.


More information about the Python-list mailing list