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

Well that's true, a function is generally written as if it's been given what it wants. I wouldn't check for other types either.

But None is a result that can happen in situations that would otherwise return exactly the expected type. If "nothingness" can be meaningful (especially in a function that accepts an empty list as a parameter, say), it's nicer if the code just deals with None itself instead of requiring checks for None in all the callers.




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

Search: