diff options
| author | Damien George | 2014-01-18 17:52:41 +0000 |
|---|---|---|
| committer | Damien George | 2014-01-18 17:52:41 +0000 |
| commit | f49ba1bd9cdbe2dbb9bb093bf0ac5cde506142c0 (patch) | |
| tree | 77208e8c58c025003cf7368cba210114e89a9cd8 /tests | |
| parent | 1d6fc94c166f459cf8a6667661be0985fab7d446 (diff) | |
Improve method lookup in mp_obj_class_lookup.
Now searches both locals_dict and methods. Partly addresses Issue #145.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/basics/tests/class_store.py | 17 |
1 files changed, 17 insertions, 0 deletions
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) |
