Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on What the Fuck Python. Parent comment
if "False": # What do you expect? True or False? print("True") else: print("False")
if bool("False"): print("True") else: print("False") # This would be different if we landed here.
Honestly it's not that hard to write something that looks like this:
def str_to_bool(val: str) -> bool: return val.lower() in ["yes", "true", "1"]
There are no comments on this comment yet.
Honestly it's not that hard to write something that looks like this: