diff options
| author | Damien George | 2017-07-07 11:47:38 +1000 |
|---|---|---|
| committer | Damien George | 2017-07-07 11:47:38 +1000 |
| commit | f69ab79ec8347c1f5ff0c6f31947ec06073fbd52 (patch) | |
| tree | a84ff982244ae882ed3bb81feacf4f539698ba9b /tests/basics | |
| parent | 145796f037715e180b441b38c1ec1ba45ff77797 (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.py | 7 |
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()))) |
