from typing import Optional
from pathlib import Path
class Style:
_path: Optional[Path]
__slots__ = [
"_path"
]
def __add__(self, style: Optional["Style"]) -> "Style":
new_style = self.__new__(Style)
if __name__ == '__main__':
Style() + Style()
CPython exits with no error but not GraalPython:
Traceback (most recent call last):
File "/home/ryuta/packages/graalvm/graalpython/rich/new.py", line 16, in <module 'new.py'>
Style() + Style()
File "/home/ryuta/packages/graalvm/graalpython/rich/new.py", line 13, in __add__
new_style = self.__new__(Style)
TypeError: object.__new__(X): X is not a type object (Style)
CPython exits with no error but not GraalPython: