Create a new validator like this one, but with given changes. Preserves all other attributes, so can be used to e.g. create a validator with a different schema but with the same :kw:`$ref` resolution behavior. >>> validator = Draft202012Validator({})
(self, **kwargs)
| 207 | """ |
| 208 | |
| 209 | def evolve(self, **kwargs) -> Validator: |
| 210 | """ |
| 211 | Create a new validator like this one, but with given changes. |
| 212 | |
| 213 | Preserves all other attributes, so can be used to e.g. create a |
| 214 | validator with a different schema but with the same :kw:`$ref` |
| 215 | resolution behavior. |
| 216 | |
| 217 | >>> validator = Draft202012Validator({}) |
| 218 | >>> validator.evolve(schema={"type": "number"}) |
| 219 | Draft202012Validator(schema={'type': 'number'}, format_checker=None) |
| 220 | |
| 221 | The returned object satisfies the validator protocol, but may not |
| 222 | be of the same concrete class! In particular this occurs |
| 223 | when a :kw:`$ref` occurs to a schema with a different |
| 224 | :kw:`$schema` than this one (i.e. for a different draft). |
| 225 | |
| 226 | >>> validator.evolve( |
| 227 | ... schema={"$schema": Draft7Validator.META_SCHEMA["$id"]} |
| 228 | ... ) |
| 229 | Draft7Validator(schema=..., format_checker=None) |
| 230 | """ |
no outgoing calls