From 3c014a67ea0c2d080905e40a1e45638fd868dccf Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 23 Dec 2014 14:06:55 +0100 Subject: py: Implement __dict__ for instances. Note that even though wrapped in MICROPY_CPYTHON_COMPAT, it is not fully compatible because the modifications to the dictionary do not propagate to the actual instance members. --- tests/basics/builtin_dict.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/basics/builtin_dict.py (limited to 'tests') diff --git a/tests/basics/builtin_dict.py b/tests/basics/builtin_dict.py new file mode 100644 index 000000000..f51ec21d0 --- /dev/null +++ b/tests/basics/builtin_dict.py @@ -0,0 +1,11 @@ +class A: + def __init__(self): + self.a=1 + self.b=2 + +try: + d=A().__dict__ + print(d['a']) + print(d['b']) +except AttributeError: + print("SKIP") -- cgit v1.2.3