changeset 12:506880d3a791

Added a test.py script and fixed a failing doctest.
author Atul Varma <varmaa@toolness.com>
date Thu, 05 Jun 2008 19:38:36 -0700
parents df25b4e145e1
children 7f8a793ba4ae
files PythonForJsProgrammers.txt test.py
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/PythonForJsProgrammers.txt	Thu Jun 05 16:38:49 2008 -0700
+++ b/PythonForJsProgrammers.txt	Thu Jun 05 19:38:36 2008 -0700
@@ -157,7 +157,6 @@
 
     >>> a = 5              # Assignment works in statements.
     >>> a += 1             # Add-assignment does too.
-    6
     >>> if a = 1:          # But you can't assign in an expression.
     ...     pass
     Traceback (most recent call last):
@@ -501,3 +500,5 @@
 comprehensions, other stuff lifted from Python by JS.
 
 TODO: Mention 'special' methods like __getattr__, etc.
+
+TODO: Explain method binding better.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test.py	Thu Jun 05 19:38:36 2008 -0700
@@ -0,0 +1,5 @@
+import doctest
+
+if __name__ == "__main__":
+    doctest.testfile("PythonForJsProgrammers.txt")
+    print "Doctests passed."