MCPcopy Index your code
hub / github.com/python-jsonschema/jsonschema / evolve

Method evolve

jsonschema/validators.py:265–278  ·  view source on GitHub ↗
(self, **changes)

Source from the content-addressed store, hash-verified

263 )
264
265 def evolve(self, **changes):
266 cls = self.__class__
267 schema = changes.setdefault("schema", self.schema)
268 NewValidator = validator_for(schema, default=cls)
269
270 for field in fields(cls): # noqa: F402
271 if not field.init:
272 continue
273 attr_name = field.name
274 init_name = field.alias
275 if init_name not in changes:
276 changes[init_name] = getattr(self, attr_name)
277
278 return NewValidator(**changes)
279
280 cls.evolve = evolve
281

Callers 2

descendMethod · 0.95
is_validMethod · 0.95

Calls 1

validator_forFunction · 0.85

Tested by

no test coverage detected