You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could imagine that the ergonomics of the API (at least in my use case :D) would be improved if one could just add a byte type instead of a string of bits as leave nodes. Internally, you could use a library like https://pypi.org/project/bitarray/ to transform the bytes to a bitarray to build the prefix trie. The library seems to have C-bindings which indicates (not guarantees) performance benefits compared to the string conversion of bytes to bitstrings. Maybe the add function signature could accept anything that's a python iterator instead of restricting it to strings?
The text was updated successfully, but these errors were encountered:
dennis-tra
changed the title
API ergonomics
Accept any iterator type as trie leaves
Jun 1, 2022
I could imagine that the ergonomics of the API (at least in my use case :D) would be improved if one could just add a
byte
type instead of a string of bits as leave nodes. Internally, you could use a library like https://pypi.org/project/bitarray/ to transform the bytes to a bitarray to build the prefix trie. The library seems to have C-bindings which indicates (not guarantees) performance benefits compared to the string conversion of bytes to bitstrings. Maybe theadd
function signature could accept anything that's a python iterator instead of restricting it to strings?The text was updated successfully, but these errors were encountered: