Hacker News new | ask | show | jobs
by dualbus 3933 days ago
x[:4].lower() = 'test' ?
1 comments

Whoops, forgot the double equal. As penance, I'll quote some Steve Yegge.

> Error Prone == Evil

> Although this concept is obvious to 99.999% of the general population, it's only accepted by 2% of computer programmers. The remaining 98% subscribe to a competing philosophy, namely: "Error Prone = Manly". Never mind that they just assigned "Manly" to the variable "Error Prone", and the expression always returns true; that happens to be the correct value in this case, so it's an acceptable hack.

Except it'd just error out with "can't assign to function call". You also can't assign in if/while (they expect an expression, while assignment makes it a statement).

So, all-in-all, in Python it's not really error prone unless you never run the code at all.

In other news, sometimes jokes are not literally true.