News for hackers. Stuff that matters.
Re:Exceptions (2003) by untothebreach on Sunday September 01, 2013 @10:48PM (#6313223)
It seems to be a pattern in Python APIs to allow the caller to decide if a given function call should throw an exception when an error occurs. For example,

    a = some_dict['nonexistent_key']
would raise a KeyError, while

    a = some_dict.get('nonexistent_key', 'DEFAULT')
would return 'DEFAULT' instead.

There are no comments on this comment yet.