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

> "Neither of them have type declarations or hints, or give me a clue what will happen if "numbers" doesn't contain numbers."

bools in Python are False==0 and True==1, and I'm now imagining an inexperienced dev believing those things are numbers and has no idea they could be anything else, and is filtering for Trues with the intent of counting them later on, but they messed up the assignment and instead of 'numbers' always getting a list of bools it sometimes gets a scalar single bool outside a list instead. They want to check for this case, but don't understand types or how to check them at all, but they have stumbled on these filter/loop which throw when run against a single answer. How useful! Now they are using those lines of code for control flow as a side effect.



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

Search: