Skip to content

Commit 8fdfca8

Browse files
committed
If it needs a loop might as well just loop without the evolver.
1 parent 5dda44b commit 8fdfca8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

jsonschema/_types.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,14 @@ def remove_many(self, types):
178178
`jsonschema.exceptions.UndefinedTypeCheck`:
179179
if any of the types are unknown to this object
180180
"""
181-
evolver = self._type_checkers.evolver()
182181

183-
for type_ in types:
182+
checkers = self._type_checkers
183+
for each in types:
184184
try:
185-
del evolver[type_]
185+
checkers = checkers.remove(each)
186186
except KeyError:
187-
raise UndefinedTypeCheck(type_)
188-
189-
return attr.evolve(self, type_checkers=evolver.persistent())
187+
raise UndefinedTypeCheck(each)
188+
return attr.evolve(self, type_checkers=checkers)
190189

191190

192191
draft3_type_checker = TypeChecker(

0 commit comments

Comments
 (0)