summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2014-12-23 14:06:55 +0100
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-01-03 20:51:26 +0200
commit3c014a67ea0c2d080905e40a1e45638fd868dccf (patch)
treea90386cf3dc16a8015313dadecb8dbbd98135f31 /tests
parent7281d95aee4084603964c1914b5f08c647669994 (diff)
downloadmicropython-3c014a67ea0c2d080905e40a1e45638fd868dccf.tar.gz
micropython-3c014a67ea0c2d080905e40a1e45638fd868dccf.zip
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/builtin_dict.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/builtin_dict.py b/tests/basics/builtin_dict.py
new file mode 100644
index 0000000000..f51ec21d00
--- /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")