Support variable length list encoding.
When cooperate with other language, I need to use encoding list with variable length encoding, currently we don't have a way to do this. I have two approaches in mind: 1、Encode tuple with fixed length encoding, encode list with variable length encoding. 2、Add a special class VarList which is inherited from list, and is encoded with variable length encoding.
What do you think?
From my perspective, variable length encoding is for Python iterators without the data structure size knowledge.
My situation is that I need to communicate between python and Haskell with cbor, the Haskell implementation use variable length encoding to encode List. So I just want to have this option.
I've implemented the option 2 in my fork, only the pure python version though.
From my perspective, variable length encoding is for Python iterators without the data structure size knowledge.
I think we don't have a way to detect directly if an object is an iterator without size knowledge, but with new VarList class, we can wrap any iterator in it like VarList(iterator_without_size). So user has the opportunity to decide which encoding they want.
This feature is fully implemented in both python and c version, already tested for a while, really hope this can be merged.