google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library

Home Page:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Python] Missing (key) and Dictionary support

CTVjweiss opened this issue · comments

FlatBuffers in other languages supports a Dictionary-esque type using binary search and sorted string keys. See FlatBuffers C++ docs for details.

I'm trying to build a binary file with Python and consume it in C#, and while the C# consumer supports the key lookup, the Python code for building the binary does not.

If I sort the entries in Python before adding them, this should in theory work, if Python's string sorting is equivalent to the binary string comparison done in the C#/C++/etc. implementations (see Table.cs for C# implementation).

It would be great if the Python implementation supported this functionality.

Feel free to submit a PR for this.

ezoic increase your site revenue