News for hackers. Stuff that matters.
Re:A few things to remember while coding in Python by makecheck on Sunday May 20, 2012 @02:43AM (#3998145)
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.

There are no comments on this comment yet.