Cannot create slots-dataclass with __dict__
In python, it is possible to create slots classes which do have an explicit __dict__ available. However, I am struggling to get this working with dataclasses: from dataclasses import dataclass @dataclass(slots=True) class A: __dict__: dict[str, object] A() This raises the following on the last line: TypeError: __dict__ must be set to a dictionary, not a 'mappingproxy' It is not even clear to me where this exception actually occurs since there is no further information provided. There also seems to be no information regarding this problem on google. What is the problem here? How do I create a s
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.