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
The MAX_HASHES is likely an artifact of being ported over from C++, which probably used a static hash table (C++ had no standard hash table for the longest time). It's totally superfluous in Python, and the branch I'm currently working on eliminates it entirely. Python dictionaries grow dynamically, and do the hashing for you, so it makes little sense to hash ahead of time (except possibly to make a compact string hash to use with shelve or anydbm). And since the table stores all the file entries anyway, limiting the range of hash values doesn't really save on memory.
As for the actual values (1024 * 128), I suspect that since C++ doesn't have an exponentiation operator like Python, it was left as a multiplication to visually indicate that the MAX_HASHES was a power of two.
What is the logic behind the max_hashes of 1028 * 128?
The text was updated successfully, but these errors were encountered: