You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See dataclasses, new in Python 3.7. (This pretty much fills the same role as MacroPy's case classes.)
We could raise dataclasses.FrozenInstanceError where appropriate.
Also, e.g. unpythonic.llist.cons doesn't need the internal readonly flag; it's simpler to just call object.__setattr__ to init the read-only fields, so the custom __setattr__ can be simplified. (Should check also other datatypes that use this pattern, maybe something in unpythonic.collections?)
Also, must intercept also __delattr__ to properly emulate immutability. Not sure if we currently do this (probably not - hence the bug label, we need to check).
The text was updated successfully, but these errors were encountered:
See dataclasses, new in Python 3.7. (This pretty much fills the same role as MacroPy's case classes.)
We could raise
dataclasses.FrozenInstanceError
where appropriate.Also, e.g.
unpythonic.llist.cons
doesn't need the internal readonly flag; it's simpler to just callobject.__setattr__
to init the read-only fields, so the custom__setattr__
can be simplified. (Should check also other datatypes that use this pattern, maybe something inunpythonic.collections
?)Also, must intercept also
__delattr__
to properly emulate immutability. Not sure if we currently do this (probably not - hence the bug label, we need to check).The text was updated successfully, but these errors were encountered: