SIGSEGV with setattr inside __set_name__
Python 3.6.9 (?, Apr 18 2020, 02:46:07) [PyPy 7.3.1 with GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-118.104.22.168)] on darwin
Minimal example that causes SIGSEGV:
class Descriptor: def __set_name__(self, owner, name): setattr(owner, "attr", self) # value must contain a reference to `self` to get SIGSEGV class Foo: desc = Descriptor() desc2 = Descriptor() # at least two `Descriptor` must be declared to get SIGSEGV
My real case is with a line like
setattr(owner, "attr", [*getattr(owner, "attr", ), self]), but
self alone is enough to make it crash.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information