IsSubclassValidator
No overview available.
Attributes
| Attribute | Type | Description |
|---|---|---|
| class | Py< PyType > | The Python type object that input values must be a subclass of to pass validation. |
| class_repr | String | A string representation of the target class used for generating clear error messages. |
| name | String | The identifier for the validator used in tracebacks and schema definitions. |
Constructor
Signature
def IsSubclassValidator(
class: Py< PyType >,
class_repr: String,
name: String
)
Parameters
| Name | Type | Description |
|---|---|---|
| class | Py< PyType > | The Python type/class to check against. |
| class_repr | String | The string representation of the class used for error messages. |
| name | String | The name of the validator instance. |
Methods
validate()
def validate(
py: Python,
input: &PyAny
) - > PyResult< PyAny >
Validates that the input value is a subclass of the specified Python class.
Parameters
| Name | Type | Description |
|---|---|---|
| py | Python | The Python interpreter instance used for type checking and object manipulation. |
| input | &PyAny | The input object to be validated as a subclass. |
Returns
| Type | Description |
|---|---|
PyResult< PyAny > | The input value if it is a valid subclass, otherwise raises a ValidationError. |