aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamien George2014-01-09 20:57:50 +0000
committerDamien George2014-01-09 20:57:50 +0000
commit062478e66d03cc59ed73484a3032ef5f08db12a4 (patch)
tree6d3beb59ade6fe3d1ab7a5f05ff876e63062717f /tests
parentd944a66ead38b15b5a3c7a4ae8b054451fd5c077 (diff)
Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.
Creating of classes (types) and instances is much more like CPython now. You can use "type('name', (), {...})" to create classes.
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/tests/class2.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/basics/tests/class2.py b/tests/basics/tests/class2.py
index 0b3b21867..64f1f62b9 100644
--- a/tests/basics/tests/class2.py
+++ b/tests/basics/tests/class2.py
@@ -5,6 +5,7 @@ class C1:
self.x = 1
c1 = C1()
+print(type(c1) == C1)
print(c1.x)
class C2:
@@ -12,4 +13,5 @@ class C2:
self.x = x
c2 = C2(4)
+print(type(c2) == C2)
print(c2.x)