From ab4d1071d0f61e15ecd552183c0920c9540ea8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 12 Dec 2023 08:58:41 +0100 Subject: [PATCH] Fix typos (#8356) --- pydantic/_internal/_generics.py | 2 +- pydantic/fields.py | 2 +- pydantic/v1/fields.py | 2 +- tests/test_main.py | 2 +- tests/test_types_typeddict.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pydantic/_internal/_generics.py b/pydantic/_internal/_generics.py index c1200d0c9d..5a66eaa957 100644 --- a/pydantic/_internal/_generics.py +++ b/pydantic/_internal/_generics.py @@ -167,7 +167,7 @@ def _get_caller_frame_info(depth: int = 2) -> tuple[str | None, bool]: depth: The depth to get the frame. Returns: - A tuple contains `module_nam` and `called_globally`. + A tuple contains `module_name` and `called_globally`. Raises: RuntimeError: If the function is not called inside a function. diff --git a/pydantic/fields.py b/pydantic/fields.py index 40819551ef..1881143569 100644 --- a/pydantic/fields.py +++ b/pydantic/fields.py @@ -927,7 +927,7 @@ def _wrapped_property_is_private(property_: cached_property | property) -> bool: return wrapped_name.startswith('_') and not wrapped_name.startswith('__') -# this should really be `property[T], cached_proprety[T]` but property is not generic unlike cached_property +# this should really be `property[T], cached_property[T]` but property is not generic unlike cached_property # See https://github.com/python/typing/issues/985 and linked issues PropertyT = typing.TypeVar('PropertyT') diff --git a/pydantic/v1/fields.py b/pydantic/v1/fields.py index b1856c109c..607bbd7b8e 100644 --- a/pydantic/v1/fields.py +++ b/pydantic/v1/fields.py @@ -817,7 +817,7 @@ def populate_validators(self) -> None: """ Prepare self.pre_validators, self.validators, and self.post_validators based on self.type_'s __get_validators__ and class validators. This method should be idempotent, e.g. it should be safe to call multiple times - without mis-configuring the field. + without misconfiguring the field. """ self.validate_always = getattr(self.type_, 'validate_always', False) or any( v.always for v in self.class_validators.values() diff --git a/tests/test_main.py b/tests/test_main.py index 5b755a68cc..f2477013d3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1533,7 +1533,7 @@ class Sub(BaseModel): s4: str = 'v4' class Parent(BaseModel): - # b will be included since fields are set idependently + # b will be included since fields are set independently model_config = ConfigDict(fields={'b': {'include': ...}}) a: int b: int diff --git a/tests/test_types_typeddict.py b/tests/test_types_typeddict.py index 8a0dfbc0af..a57ae22857 100644 --- a/tests/test_types_typeddict.py +++ b/tests/test_types_typeddict.py @@ -735,7 +735,7 @@ class Model(BaseModel): ] -def test_typeddict_inheritence(TypedDict: Any) -> None: +def test_typeddict_inheritance(TypedDict: Any) -> None: class Parent(TypedDict): x: int