@@ -1008,7 +1008,7 @@ def __classcall__(cls, *args, **options):
1008
1008
True
1009
1009
"""
1010
1010
instance = typecall (cls , * args , ** options )
1011
- assert isinstance ( instance , cls )
1011
+ assert isinstance (instance , cls )
1012
1012
if instance .__class__ .__reduce__ == CachedRepresentation .__reduce__ :
1013
1013
instance ._reduction = (cls , args , options )
1014
1014
return instance
@@ -1090,16 +1090,14 @@ def _clear_cache_(cls):
1090
1090
sage: c is C(3)
1091
1091
False
1092
1092
"""
1093
- del_list = []
1094
1093
cache = None
1094
+ # not clear why the loop below is taking the last C
1095
1095
for C in cls .mro ():
1096
1096
try :
1097
1097
cache = C .__classcall__ .cache
1098
1098
except AttributeError :
1099
1099
pass
1100
- for k in cache :
1101
- if issubclass (k [0 ][0 ],cls ):
1102
- del_list .append (k )
1100
+ del_list = [k for k in cache if issubclass (k [0 ][0 ], cls )]
1103
1101
for k in del_list :
1104
1102
del cache [k ]
1105
1103
@@ -1149,6 +1147,7 @@ def __deepcopy__(self, memo):
1149
1147
"""
1150
1148
return self
1151
1149
1150
+
1152
1151
def unreduce (cls , args , keywords ):
1153
1152
"""
1154
1153
Calls a class on the given arguments::
@@ -1166,7 +1165,7 @@ def unreduce(cls, args, keywords):
1166
1165
1167
1166
class UniqueRepresentation (CachedRepresentation , WithEqualityById ):
1168
1167
r"""
1169
- Classes derived from UniqueRepresentation inherit a unique
1168
+ Classes derived from `` UniqueRepresentation`` inherit a unique
1170
1169
representation behavior for their instances.
1171
1170
1172
1171
.. SEEALSO::
0 commit comments