Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my mind,I just automatically translate a EXPRESSION1 b EXPRESSION2 c as (a EXPRESSION1 b) and (b EXPRESSION2 c), so there's no ambiguity. But I agree, it can be very confusing,so I tend to write code that is easy to read without being a master. For example, what would have guessed this evaluates to:

False is False is False. If you thought, True, you were right :)

I would recommend to take a look at one of my favourite repos for more[1].

[1]https://github.com/satwikkansal/wtfpython



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: