Skip to content

Commit

Permalink
experimental patch
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Mar 24, 2024
1 parent 5b5e025 commit 191c2c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sage/structure/unique_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,13 +1091,16 @@ def _clear_cache_(cls):
False
"""
cache = None
how_many = 0
for C in cls.mro():
try:
cache = C.__classcall__.cache
except AttributeError:
pass
else:
break
how_many += 1 # break
if how_many > 1:
raise RuntimeError(f"several caches in {cls}")
del_list = [k for k in cache
if issubclass(k[0][0], cls)]
for k in del_list:
Expand Down

0 comments on commit 191c2c3

Please sign in to comment.