X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/pydantic
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pydantic
/
ðŸ“
..
📄
__init__.py
(5.68 KB)
ðŸ“
__pycache__
ðŸ“
_internal
📄
_migration.py
(11.62 KB)
📄
alias_generators.py
(1.11 KB)
📄
annotated_handlers.py
(4.24 KB)
📄
class_validators.py
(147 B)
📄
color.py
(20.99 KB)
📄
config.py
(24.16 KB)
📄
dataclasses.py
(11.22 KB)
📄
datetime_parse.py
(149 B)
📄
decorator.py
(144 B)
ðŸ“
deprecated
📄
env_settings.py
(147 B)
📄
error_wrappers.py
(149 B)
📄
errors.py
(4.49 KB)
📄
fields.py
(44.45 KB)
📄
functional_serializers.py
(10.53 KB)
📄
functional_validators.py
(19.99 KB)
📄
generics.py
(143 B)
📄
json.py
(139 B)
📄
json_schema.py
(98.33 KB)
📄
main.py
(60.8 KB)
📄
mypy.py
(49.53 KB)
📄
networks.py
(20.06 KB)
📄
parse.py
(140 B)
ðŸ“
plugin
📄
py.typed
(0 B)
📄
root_model.py
(4.83 KB)
📄
schema.py
(141 B)
📄
tools.py
(140 B)
📄
type_adapter.py
(18.38 KB)
📄
types.py
(70.54 KB)
📄
typing.py
(137 B)
📄
utils.py
(140 B)
ðŸ“
v1
📄
validate_call.py
(1.74 KB)
📄
validators.py
(145 B)
📄
version.py
(2.25 KB)
📄
warnings.py
(1.9 KB)
Editing: validate_call.py
"""Decorator for validating function calls.""" from __future__ import annotations as _annotations from typing import TYPE_CHECKING, Any, Callable, TypeVar, overload from ._internal import _validate_call __all__ = ('validate_call',) if TYPE_CHECKING: from .config import ConfigDict AnyCallableT = TypeVar('AnyCallableT', bound=Callable[..., Any]) @overload def validate_call( *, config: ConfigDict | None = None, validate_return: bool = False ) -> Callable[[AnyCallableT], AnyCallableT]: ... @overload def validate_call(__func: AnyCallableT) -> AnyCallableT: ... def validate_call( __func: AnyCallableT | None = None, *, config: ConfigDict | None = None, validate_return: bool = False, ) -> AnyCallableT | Callable[[AnyCallableT], AnyCallableT]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/validation_decorator/ Returns a decorated wrapper around the function that validates the arguments and, optionally, the return value. Usage may be either as a plain decorator `@validate_call` or with arguments `@validate_call(...)`. Args: __func: The function to be decorated. config: The configuration dictionary. validate_return: Whether to validate the return value. Returns: The decorated function. """ def validate(function: AnyCallableT) -> AnyCallableT: if isinstance(function, (classmethod, staticmethod)): name = type(function).__name__ raise TypeError(f'The `@{name}` decorator should be applied after `@validate_call` (put `@{name}` on top)') return _validate_call.ValidateCallWrapper(function, config, validate_return) # type: ignore if __func: return validate(__func) else: return validate
Upload File
Create Folder