We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Currently, can make an assignment to an instance's __dict__ attribute but the value must be an actual dict. It should allow frozendict as well.
__dict__
frozendict
This would be useful for making immutable instances without the awkward work arounds used in frozen dataclasses.
>>> class Point: ... def __init__(self, x, y): ... self.__dict__ = frozendict(x=x, y=y) ... >>> p = Point(10, 20) Traceback (most recent call last): File "<pyshell#53>", line 1, in <module> p = Point(10, 20) File "<pyshell#52>", line 3, in __init__ self.__dict__ = frozendict(x=x, y=y) TypeError: __dict__ must be set to a dictionary, not a 'frozendict'
Currently, can make an assignment to an instance's
__dict__attribute but the value must be an actual dict. It should allowfrozendictas well.This would be useful for making immutable instances without the awkward work arounds used in frozen dataclasses.
Linked PRs