Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Something like boost::multi_index for Python

I have come to appreciate a lot boost::multi_index in C++. It happens that I would happily use something like that in Python; for scripts that process data coming out from numerical intensive applications. Is there such a thing for Python? I just want to be sure that it doesn't exist, then I would try to implement it myself. Things that won't do it for me:

  • Wrapping boost::multi_index in Python. It simply doesn't scale.

  • Using sqlite3 in memory. It is ugly.

like image 204
dsign Avatar asked Oct 25 '22 06:10

dsign


1 Answers

Since python collections only store references to objects, not objects themselves, theres isn't much difference between having one collection with multiple indexing schemes, and just having multiple collections.

You can for example have several dicts with your data, each of them using different keys to refer to them.

like image 167
Radomir Dopieralski Avatar answered Nov 03 '22 22:11

Radomir Dopieralski