# HG changeset patch # User Atul Varma # Date 1212704698 25200 # Node ID 758a15a83be88c7ab53ef69b9c925c21785e6a5a # Parent ae28bd3be137318be3733ea4110bdf00896c22f5 More stuff. diff -r ae28bd3be137 -r 758a15a83be8 PythonForJsProgrammers.txt --- a/PythonForJsProgrammers.txt Thu Jun 05 15:19:42 2008 -0700 +++ b/PythonForJsProgrammers.txt Thu Jun 05 15:24:58 2008 -0700 @@ -145,6 +145,21 @@ ... SyntaxError: invalid syntax +Nothingness +=========== + +Unlike JavaScript, Python doesn't have a concept of ``undefined``. +Instead, things that would normally cause ``undefined`` to be returned +by JavaScript simply end up raising an exception in Python: + + >>> "a string".foo + Traceback (most recent call last): + ... + AttributeError: 'str' object has no attribute 'foo' + +Python does have an analog to JavaScript's ``null``: it's called +``None``. + Functions =========