insperatum / pregex

Probabilistic regular expressions
18 stars 4 forks source link

scary scary issue -- backwards compatibility #3

Open mtensor opened 5 years ago

mtensor commented 5 years ago

okay so: EC repo was using this old version of pregex: https://github.com/insperatum/pregex/blob/b5eab11e4b1176cd0df5adbc10a94f902294ed6b/pregex.py

We had pickled some pregexes. I updated submodule to today's version of pregex, and i was hitting the assert statement on ln 256, because pickle was loading the name and putting it into the CharacterClass.__new__ keyword argument for ps.

So I switched the order of name and ps in CharacterClass.__new__, and it worked fine. Scary scary stuff.

mtensor commented 5 years ago

I pushed this change. Hope it doesn't break anything... which it shouldn't