-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API refactor for rlp.Serializable #61
Comments
Seems reasonable. It would be nice to think through how we would need to re-work current subclasses, like: https://github.com/ethereum/eth-rlp/blob/master/eth_rlp/main.py#L13 |
The one major breaking change that I want to make is removal of |
I don't see any |
IIRC we settled on an immutable-only approach. |
* Add breaking change type to newsfragment * Move breaking-change -> breaking
I've some thoughts on how we might change
rlp.Serializable
.Current features
make_mutable
,make_immutable
).*args
or**kwargs
cls.exclude
API for creating classes with a subset of fieldsInefficiencies
__setattr__
(60% faster to use direct attribute assignment)obj.fields
is non-ideal since it disallows the use of any field namedfields
Solution
collections.namedtuple
for immutable versions of the object. Fields are naturally ordered, and immutability is enforced by default.The text was updated successfully, but these errors were encountered: