From a5721c7bf0dee14caf8aeb3a90cdd556bc55b8e0 Mon Sep 17 00:00:00 2001 From: Albert Zeyer Date: Tue, 7 May 2024 22:16:59 +0200 Subject: [PATCH] longer comments --- sisyphus/hash.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sisyphus/hash.py b/sisyphus/hash.py index 2b61eae..dd5893d 100644 --- a/sisyphus/hash.py +++ b/sisyphus/hash.py @@ -64,7 +64,8 @@ def get_object_state(obj): if isinstance(obj, enum.Enum): assert isinstance(state, dict) - state.pop("_sort_order_", None) # compat with Python <=3.10, https://github.com/rwth-i6/sisyphus/issues/188 + # In Python >=3.11, keep hash same as in Python <=3.10, https://github.com/rwth-i6/sisyphus/issues/188 + state.pop("_sort_order_", None) if args is None: return state @@ -125,5 +126,6 @@ def sis_hash_helper(obj): def _obj_type_qualname(obj) -> bytes: if type(obj) is enum.EnumMeta: # EnumMeta is old alias for EnumType - return b"EnumMeta" # compat with Python <=3.10, https://github.com/rwth-i6/sisyphus/issues/188 + # In Python >=3.11, keep hash same as in Python <=3.10, https://github.com/rwth-i6/sisyphus/issues/188 + return b"EnumMeta" return type(obj).__qualname__.encode()