Comments (2)
Raising NotImplementedError in a setter is actually not needed. Simply not defining a setter will suffice (and cause an AttributeError in case setting the property is attempted).
from pyrlp.
- Serializable now has attributes
rlp_
andmutable_
(trailing underscore to distinguish from possibly clashing field names) - if
mutable_
isFalse
, attempts to set field values throw aValueError
. Note that (1)mutable_
is not recursive (i.e.block.mutable_
andblock.header.mutable_
are independent, although they have the same value after initialization) and (2) changes of existing objects are not tracked (e.g. it does not prevent appending to a list). rlp.decode(s)
setsrlp_
tos
and (implicitly bydeserialize
)mutable_
toFalse
.rlp.encode(obj)
returnsobj.rlp_
if it's thererlp.encode(obj, sedes=SomeClass)
ignoresrlp_
(because different serializers can lead to different rlp, e.g.rlp.encode(tx, Transaction)
vsrlp.encode(tx, UnsignedTransaction)
)
To mutate an immutable object, set mutable_
to True
and (if the changes are persistent) rlp_
to None
.
from pyrlp.
Related Issues (20)
- Instantiating empty Serializable fails HOT 3
- Defining a Serializable with an empty field set fails HOT 1
- Migrate to Circle CI HOT 2
- Cut minior point release
- Library is not flexible enough to handle Parity's custom compression
- Cannot (de)serialize objects with optional fields HOT 3
- `rlp.decode` does not allow `memoryview` objects
- encode differs from ethereumjs/rlp.encode HOT 1
- Exception description
- Use cython backend for speedup HOT 1
- Live docs link to very old version of docs HOT 3
- How to disable the warning "Consider installing rusty-rlp to improve pyrlp"? HOT 4
- New `List` results in `RecursionError: maximum recursion depth exceeded in comparison` HOT 3
- `make dist` is broken due to deprecated use of `pypandoc` HOT 1
- rlp decode cant support decode EIP1559 rawtransaction HOT 1
- Failed while import rlp 1.0.1 in python3.6 HOT 1
- TypeError: Did not find sedes handling type str HOT 1
- Error importing library HOT 1
- No caching of RLP when decoding a List of Serializable items HOT 11
- ImportError: cannot import name 'encode_hex' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrlp.