Closed albertz closed 5 months ago
Am i the only one using a more recent Python?
It seems so.
suggest a fix on Sisyphus side to always keep the old python <=3.10 hash of enum
yes, agreed.
I didn't expect the enum state to blow up like that. There would also be the option to encode it into something shorter, e.g. b'(Enum, i6_core.corpus.transform. MergeStrategy.Flat)', but that would now change the hash. Keeping the old behavior looks reasonable to me.
The use of
enum.Enum
currently results in different Sisyphus hashes depending on the Python version…E.g. from i6_core, we have:
sis_hash_helper(MergeStrategy.FLAT)
gives:b"(MergeStrategy, (dict, (tuple, (str, '__objclass__'), (EnumType, (tuple, (str, 'i6_core.corpus.transform'), (str, 'MergeStrategy')))), (tuple, (str, '_name_'), (str, 'FLAT')), (tuple, (str, '_sort_order_'), (int, 1)), (tuple, (str, '_value_'), (int, 1))))"
b"(MergeStrategy, (dict, (tuple, (str, '__objclass__'), (EnumMeta, (tuple, (str, 'i6_core.corpus.transform'), (str, 'MergeStrategy')))), (tuple, (str, '_name_'), (str, 'FLAT')), (tuple, (str, '_value_'), (int, 1))))"
I think most people still use Python <=3.10? Am i the only one using a more recent Python? I would suggest a fix on Sisyphus side to always keep the old python <=3.10 hash of
enum
, even on newer Python versions. That will require a special check forenum
, but I think that’s ok.