
Nov. 29, 2017
1:01 p.m.
29.11.17 14:39, Nick Coghlan пише:
"a if def else b" -> pronounced "a if defined, else b"
I understand "a if defined, else b" as try: result = a except (NameError, AttributeError, LookupError): result = b The problem is that None is not undefined. This is a regular value. Seems it is not so special in Python as NULL or undef in other languages. Python even don't have a special purposed NullPointerException (or NoneError).