[pypy-svn] r41026 - pypy/dist/demo

ac at codespeak.net ac at codespeak.net
Thu Mar 22 12:54:20 CET 2007


Author: ac
Date: Thu Mar 22 12:54:19 2007
New Revision: 41026

Modified:
   pypy/dist/demo/tp-persistence.py
   pypy/dist/demo/tp-print-builtin-operation.py
Log:
Minor editing of demos.

Modified: pypy/dist/demo/tp-persistence.py
==============================================================================
--- pypy/dist/demo/tp-persistence.py	(original)
+++ pypy/dist/demo/tp-persistence.py	Thu Mar 22 12:54:19 2007
@@ -45,7 +45,7 @@
     storage = py.path.local("/tmp/dictpickle")
     pdict = make_persistent_proxy({}, storage) 
 
-    # the below is not aware of using the proxy 
+    # the code below is not aware of pdict being a proxy 
     assert type(pdict) is dict
     pdict['hello'] = 'world'       
     pdict['somelist'] = []

Modified: pypy/dist/demo/tp-print-builtin-operation.py
==============================================================================
--- pypy/dist/demo/tp-print-builtin-operation.py	(original)
+++ pypy/dist/demo/tp-print-builtin-operation.py	Thu Mar 22 12:54:19 2007
@@ -15,12 +15,13 @@
     tproxy = make_proxy(controller, obj=instance)
     return tproxy
 
-mydict = make_show_proxy({}) 
+if __name__ == '__main__':
+    mydict = make_show_proxy({}) 
 
-assert type(mydict) is dict      # this looks exactly like a dict 
-mydict['hello'] = 'world'        # will print __
-mydict[42] = 23 
-assert mydict.pop('hello') == 'world'
-assert mydict.popitem() == (42,23)
+    assert type(mydict) is dict            # this looks exactly like a dict 
+    mydict['hello'] = 'world'              # will print __setitem__
+    mydict[42] = 23                        # will print __setitem__
+    assert mydict.pop('hello') == 'world'  # will print pop
+    assert mydict.popitem() == (42,23)     # will print popitem
 
 



More information about the Pypy-commit mailing list