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.
This would be useful for making immutable instances without the awkward work arounds used in frozen dataclasses.
>>>classPoint:
... def__init__(self, x, y):
... self.__dict__=frozendict(x=x, y=y)
...
>>>p=Point(10, 20)
Traceback (mostrecentcalllast):
File"<pyshell#53>", line1, in<module>p=Point(10, 20)
File"<pyshell#52>", line3, in__init__self.__dict__=frozendict(x=x, y=y)
TypeError: __dict__mustbesettoadictionary, nota'frozendict'
Linked PRs
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