Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
30238:using isinstance in __reduce__
Browse files Browse the repository at this point in the history
  • Loading branch information
seblabbe committed Jul 30, 2020
1 parent cc0b7ae commit df88874
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/sage/sets/recursively_enumerated_set.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -530,21 +530,14 @@ cdef class RecursivelyEnumeratedSet_generic(Parent):
except AttributeError:
pp = None

classname = self.__class__.__name__
if classname.startswith('RecursivelyEnumeratedSet_graded'):
if isinstance(self, RecursivelyEnumeratedSet_graded):
struct = 'graded'
elif classname.startswith('RecursivelyEnumeratedSet_symmetric'):
elif isinstance(self, RecursivelyEnumeratedSet_symmetric):
struct = 'symmetric'
elif classname.startswith('RecursivelyEnumeratedSet_forest'):
elif isinstance(self, RecursivelyEnumeratedSet_forest):
struct = 'forest'
elif classname.startswith('RecursivelyEnumeratedSet_generic'):
struct = None
else:
A = isinstance(self, RecursivelyEnumeratedSet_generic)
raise TypeError("classname(={}) does not start with"
" RecursivelyEnumeratedSet but"
" isinstance(self, RecursivelyEnumeratedSet_generic)"
" returns {}".format(classname, A))
struct = None

args = (self._seeds, self.successors, struct,
self._enumeration, self._max_depth, pp)
Expand Down

0 comments on commit df88874

Please sign in to comment.