darvid / python-hyperscan

🐍 A CPython extension for the Hyperscan regular expression matching library.
https://python-hyperscan.readthedocs.io/en/latest/
MIT License
165 stars 28 forks source link

loadb docs example requires a mode #152

Open jcushman opened 4 months ago

jcushman commented 4 months ago

As of v0.5.0 this example from the docs doesn't work:

# Deserializing (loading from bytes):
db = hyperscan.loadb(serialized)

because loadb has a mandatory mode parameter. Do the docs want to be updated to db = hyperscan.loadb(serialized, mode=hyperscan.HS_MODE_BLOCK), or does loadb want a default mode value? I'm guessing you added the breaking change because it's unsafe to loadb without supplying the same mode that was used when dumping, so the fix is a docs update.