From 57971aacb42a406c7c547a754e4682d727383550 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 5 Mar 2019 15:20:36 +0100 Subject: [PATCH] Update simple-serialize.md --- specs/simple-serialize.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/specs/simple-serialize.md b/specs/simple-serialize.md index 31839b27e..a452213b5 100644 --- a/specs/simple-serialize.md +++ b/specs/simple-serialize.md @@ -12,8 +12,7 @@ This is a **work in progress** describing typing, serialization and Merkleizatio - [Serialization](#serialization) - [`uintN`](#uintn) - [`bool`](#bool) - - [Tuples](#lists) - - [Containers, lists](#containers-lists) + - [Tuples, containers, lists](#tuples-containers-lists) - [Deserialization](#deserialization) - [Merkleization](#merkleization) - [Self-signed containers](#self-signed-containers) @@ -69,13 +68,15 @@ assert value in (True, False) return b'\x01' if value is True else b'\x00' ``` -### Tuples +### Tuples, containers, lists + +If `value` is fixed-length (i.e. does not embed a list): ```python return ''.join([serialize(element) for element in value]) ``` -### Containers, lists +If `value` is variable-length (i.e. embeds a list): ```python serialized_bytes = ''.join([serialize(element) for element in value])