eddieantonio / perfection

Simple perfect hashing in Python
https://pypi.python.org/pypi/perfection
MIT License
12 stars 6 forks source link

perfection.czech api fails #6

Open za3k opened 1 year ago

za3k commented 1 year ago

The API does not appear to accept a list of integers (matching import perfection)


  File "/home/zachary/golf_css_colors.py", line 114, in <module>
    for h in possible_functions():
  File "/home/zachary/golf_css_colors.py", line 109, in possible_functions
    hf=perfection.czech.make_hash(xs)
  File "/home/zachary/.local/lib/python3.10/site-packages/perfection/czech.py", line 249, in make_hash
    return CzechHashBuilder(words, *args, **kwargs).hash_function
  File "/home/zachary/.local/lib/python3.10/site-packages/perfection/czech.py", line 42, in __init__
    self.indices = list(range(len(words[0])))
TypeError: object of type 'int' has no len()```
eddieantonio commented 1 year ago

Yep. Clearly I hadn't settled on an API that works for any hashable object, as would probably be a reasonable API expectation! This has been an issue for... \<checks notes> SIX YEARS?!?!?!

If I find time, I might revisit this repository and clean things up, but that probably won't be for another two weeks. I'll be honest, I kind of forget about this repo >.<