-
Couldn't load subscription status.
- Fork 140
Closed
Description
Given this file:
class Marker(object):
__slots__ = ("__hash__",)
def __init__(self):
self.__hash__ = lambda: hash("key")
def __eq__(self, other):
return True
hash(Marker())The result when running with GraalPy 3.12.8 (Oracle GraalVM Native 25.0.1):
$ bin/graalpy test.py
Traceback (most recent call last):
File "/home/cody/graalvm/graalpy-25.0.1-linux-amd64/test.py", line 10, in <module>
hash(Marker())
File "/home/cody/graalvm/graalpy-25.0.1-linux-amd64/test.py", line 5, in __init__
self.__hash__ = lambda: hash("key")
AttributeError: 'Marker' object has no attribute '__hash__'
$
But running under CPython Python 3.12.3 runs just fine (no output, as expected):
$ python3 test.py
$
It also works just fine under GraalPy 3.11.7 (Oracle GraalVM Native 24.2.2), so this is a regression with Graal 25:
$ bin/graalpy test.py
$
Of note, this is a distilled test case from voluptuous. The full class is at https://github.com/alecthomas/voluptuous/blob/master/voluptuous/schema_builder.py#L948
Metadata
Metadata
Assignees
Labels
No labels