aboutsummaryrefslogtreecommitdiff
path: root/tests/basics
diff options
context:
space:
mode:
authorDamien George2017-07-07 11:47:38 +1000
committerDamien George2017-07-07 11:47:38 +1000
commitf69ab79ec8347c1f5ff0c6f31947ec06073fbd52 (patch)
treea84ff982244ae882ed3bb81feacf4f539698ba9b /tests/basics
parent145796f037715e180b441b38c1ec1ba45ff77797 (diff)
py/objgenerator: Allow to hash generators and generator instances.
Adds nothing to the code size, since it uses existing empty slots in the type structures.
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/builtin_hash_gen.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/basics/builtin_hash_gen.py b/tests/basics/builtin_hash_gen.py
new file mode 100644
index 000000000..d42e5ebfb
--- /dev/null
+++ b/tests/basics/builtin_hash_gen.py
@@ -0,0 +1,7 @@
+# test builtin hash function, on generators
+
+def gen():
+ yield
+
+print(type(hash(gen)))
+print(type(hash(gen())))