From f49ba1bd9cdbe2dbb9bb093bf0ac5cde506142c0 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 18 Jan 2014 17:52:41 +0000 Subject: Improve method lookup in mp_obj_class_lookup. Now searches both locals_dict and methods. Partly addresses Issue #145. --- tests/basics/tests/class_store.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/basics/tests/class_store.py (limited to 'tests') diff --git a/tests/basics/tests/class_store.py b/tests/basics/tests/class_store.py new file mode 100644 index 000000000..658da451b --- /dev/null +++ b/tests/basics/tests/class_store.py @@ -0,0 +1,17 @@ +# store to class vs instance + +class C: + pass + +c = C() +c.x = 1 +print(c.x) +C.x = 2 +C.y = 3 +print(c.x, c.y) +print(C.x, C.y) +print(C().x, C().y) +c = C() +print(c.x) +c.x = 4 +print(c.x) -- cgit v1.2.3