True == 1 weirdness

Sven R. Kunze srkunze at mail.de
Wed Sep 16 17:03:41 EDT 2015



On 16.09.2015 22:55, Random832 wrote:
> 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.

Yes. Let's introduce ASCII art an way to describe graphs in Python.


Best,
Sven



More information about the Python-list mailing list