Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cattrs/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def is_mutable_sequence(type: Any) -> bool:
def is_sequence(type: Any) -> bool:
"""A predicate function for sequences.

Matches lists, sequences, mutable sequences, deques and homogenous
Matches lists, sequences, mutable sequences, deques and homogeneous
tuples.
"""
origin = getattr(type, "__origin__", None)
Expand Down
4 changes: 2 additions & 2 deletions src/cattrs/cols.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def structure_list(
def homogenous_tuple_structure_factory(
type: type, converter: BaseConverter
) -> StructureHook:
"""A hook factory for homogenous (all elements the same, indeterminate length) tuples.
"""A hook factory for homogeneous (all elements the same, indeterminate length) tuples.

Converts any given iterable into a tuple.
"""
Expand Down Expand Up @@ -217,7 +217,7 @@ def namedtuple_structure_factory(
cl: type[tuple], converter: BaseConverter
) -> StructureHook:
"""A hook factory for structuring namedtuples from iterables."""
# We delegate to the existing infrastructure for heterogenous tuples.
# We delegate to the existing infrastructure for heterogeneous tuples.
hetero_tuple_type = tuple[tuple(cl.__annotations__.values())]
base_hook = converter.get_structure_hook(hetero_tuple_type)
return lambda v, _: cl(*base_hook(v, hetero_tuple_type))
Expand Down
6 changes: 3 additions & 3 deletions src/cattrs/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def _structure_tuple(self, obj: Iterable, tup: type[T]) -> T:
# Just a Tuple. (No generic information.)
return tuple(obj)
if has_ellipsis:
# We're dealing with a homogenous tuple, tuple[int, ...]
# We're dealing with a homogeneous tuple, tuple[int, ...]
tup_type = tup_params[0]
conv = self._structure_func.dispatch(tup_type)
if self.detailed_validation:
Expand All @@ -952,7 +952,7 @@ def _structure_tuple(self, obj: Iterable, tup: type[T]) -> T:
return tuple(res)
return tuple(conv(e, tup_type) for e in obj)

# We're dealing with a heterogenous tuple.
# We're dealing with a heterogeneous tuple.
exp_len = len(tup_params)
if self.detailed_validation:
errors = []
Expand Down Expand Up @@ -1128,7 +1128,7 @@ def __init__(
if FrozenSetSubscriptable not in co:
co[FrozenSetSubscriptable] = co[OriginAbstractSet]

# abc.MutableSet overrrides, if defined, apply to sets
# abc.MutableSet overrides, if defined, apply to sets
if OriginMutableSet in co and set not in co:
co[set] = co[OriginMutableSet]

Expand Down
4 changes: 2 additions & 2 deletions src/cattrs/gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def make_hetero_tuple_structure_fn(
detailed_validation: bool | Literal["from_converter"] = "from_converter",
use_linecache: bool = True,
) -> HeteroTupleStructureFn:
"""Generate a specialized structuring function for a heterogenous tuple.
"""Generate a specialized structuring function for a heterogeneous tuple.

.. versionadded:: NEXT
"""
Expand Down Expand Up @@ -962,7 +962,7 @@ def make_hetero_tuple_unstructure_fn(
unstructure_to: Any = None,
type_args: tuple | None = None,
) -> HeteroTupleUnstructureFn:
"""Generate a specialized unstructure function for a heterogenous tuple.
"""Generate a specialized unstructure function for a heterogeneous tuple.

:param type_args: If provided, override the type arguments.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/cattrs/strategies/_subclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def include_subclasses(
:param cl: A base `attrs` or `dataclass` class.
:param converter: The `Converter` on which this strategy is applied. Do note that
the strategy does not work for a :class:`cattrs.BaseConverter`.
:param subclasses: A tuple of sublcasses whose ancestor is `cl`. If left as `None`,
:param subclasses: A tuple of subclasses whose ancestor is `cl`. If left as `None`,
subclasses are detected using recursively the `__subclasses__` method of `cl`
and its descendents.
:param union_strategy: A callable of two arguments passed by position
Expand Down
Loading