changeset 626:89a72399286b

adding file demonstrating classes
author Jeff Hammel <k0scist@gmail.com>
date Mon, 17 Feb 2014 17:33:23 -0800
parents e92bd004b906
children 870af8d51552
files python/example/classes.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/example/classes.py	Mon Feb 17 17:33:23 2014 -0800
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+"""
+illustrate how classes work
+"""
+
+class A:
+    pass
+
+tests = ["issubclass(A, A)"]
+
+if __name__ == '__main__':
+    for test in tests:
+        print ("? {}".format(test))
+        print (eval(test))