Hacker News new | past | comments | ask | show | jobs | submit login

There's nothing wrong with `is l`. Sounds like you're just splitting hairs.

He's defending against None because calling __len__ on None results in an exception.

3.14159 also results in an exception but it's far more likely that the object passed was None than that it was a completely different type than the one expected.




> it's far more likely that the object passed was None than that it was a completely different type than the one expected.

FYI, None is a completely different type than the one expected.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: