Update simple-serialize.md

This commit is contained in:
Justin 2019-03-01 12:02:29 +01:00 committed by GitHub
parent 67793edc8d
commit 25ef2553c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -12,7 +12,8 @@ This is a **work in progress** describing typing, serialization and Merkleizatio
- [Serialization](#serialization)
- [`uintN`](#uintn)
- [`bool`](#bool)
- [Containers, tuples, lists](#containers-tuples-lists)
- [Tuples](#lists)
- [Containers, lists](#containers-lists)
- [Deserialization](#deserialization)
- [Merkleization](#merkleization)
- [Self-signed containers](#self-signed-containers)
@ -68,7 +69,13 @@ assert value in (True, False)
return b'\x01' if value is True else b'\x00'
```
### Containers, tuples, lists
### Tuples
```python
return ''.join([serialize(element) for element in value])
```
### Containers, lists
```python
serialized_bytes = ''.join([serialize(element) for element in value])