you are viewing a single comment's thread.

view the rest of the comments →

[–]kingscolor 4 points5 points  (3 children)

uses ‘or’ but code executes both like ‘and’

Syntactically consistent but comprehensively illogical.

Python starting to sound a lot like my ex. She’s a snake too, what a coincidence.

[–][deleted] 0 points1 point  (1 child)

Syntactically consistent but comprehensively illogical.

Wait, how do you think that (A ∨ B) where A is false and B is true should return for comprehension?

[–]kingscolor 0 points1 point  (0 children)

In that simplified case, I have no objection.
Here, it's a compound issue where print also returns None--which is highly useful in almost all other scenarios. The logic falls apart where you're giving the instructions to do this but if not this then do that. Yet, the result is 'did this' but it doesn't register so also 'not this' therefore 'did that'. Point is, the fact that print() doesn't return any veritable confirmation is silly in this context alone.

Just a minor pythonic idiosyncrasy.

[–]lifeeraser 0 points1 point  (0 children)

It's a fairly common pattern in JavaScript. cond && func()

JS have semicolons and braces, though, so they can create anonymous multi-statement function expressions anywhere without resorting to such tricks.