Skip to content

Commit

Permalink
longer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed May 7, 2024
1 parent 6751a98 commit a5721c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sisyphus/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

0 comments on commit a5721c7

Please sign in to comment.