summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-04-05 12:50:43 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-04-05 12:51:58 +0300
commit91cbe6033a8fec6b11c414670f7ed75e9598857c (patch)
treec22a69449cf97dcd6a7ea7741453cd5211957844 /tests/basics
parentc6813d92db57c0973d0c93e1053deb4181076277 (diff)
downloadmicropython-91cbe6033a8fec6b11c414670f7ed75e9598857c.tar.gz
micropython-91cbe6033a8fec6b11c414670f7ed75e9598857c.zip
py: Allow types to be hashable.
Quite natural to have d[int] = handle_int .
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/types_hash.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/types_hash.py b/tests/basics/types_hash.py
new file mode 100644
index 0000000000..2595097d2d
--- /dev/null
+++ b/tests/basics/types_hash.py
@@ -0,0 +1,6 @@
+# Types are hashable
+print(hash(type) != 0)
+print(hash(int) != 0)
+print(hash(list) != 0)
+class Foo: pass
+print(hash(Foo) != 0)