Skip to content

Commit

Permalink
Fix type parameters name
Browse files Browse the repository at this point in the history
  • Loading branch information
KaQuMiQ authored Dec 30, 2024
1 parent e8b886b commit c18f245
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "haiway"
description = "Framework for dependency injection and state management within structured concurrency model."
version = "0.7.1"
version = "0.7.2"
readme = "README.md"
maintainers = [
{ name = "Kacper Kaliński", email = "[email protected]" },
Expand Down
10 changes: 5 additions & 5 deletions src/haiway/state/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __new__(
),
)

state_type.__PARAMETERS__ = type_parameters # pyright: ignore[reportAttributeAccessIssue]
state_type.__TYPE_PARAMETERS__ = type_parameters # pyright: ignore[reportAttributeAccessIssue]
state_type.__ATTRIBUTES__ = attributes # pyright: ignore[reportAttributeAccessIssue]
state_type.__slots__ = frozenset(attributes.keys()) # pyright: ignore[reportAttributeAccessIssue]
state_type.__match_args__ = state_type.__slots__ # pyright: ignore[reportAttributeAccessIssue]
Expand Down Expand Up @@ -139,7 +139,7 @@ def __subclasscheck__( # noqa: C901, PLR0911, PLR0912
# then check if we are parametrized
checked_parameters: Mapping[str, Any] | None = getattr(
self,
"__PARAMETERS__",
"__TYPE_PARAMETERS__",
None,
)
if checked_parameters is None:
Expand All @@ -152,7 +152,7 @@ def __subclasscheck__( # noqa: C901, PLR0911, PLR0912
# we can verify all of the attributes to check if we have common base
available_parameters: Mapping[str, Any] | None = getattr(
subclass,
"__PARAMETERS__",
"__TYPE_PARAMETERS__",
None,
)

Expand Down Expand Up @@ -204,7 +204,7 @@ class State(metaclass=StateMeta):

_: ClassVar[Self]
__IMMUTABLE__: ClassVar[EllipsisType] = ...
__PARAMETERS__: ClassVar[Mapping[str, Any] | None] = None
__TYPE_PARAMETERS__: ClassVar[Mapping[str, Any] | None] = None
__ATTRIBUTES__: ClassVar[dict[str, StateAttribute[Any]]]

@classmethod
Expand All @@ -213,7 +213,7 @@ def __class_getitem__(
type_argument: tuple[type[Any], ...] | type[Any],
) -> type[Self]:
assert Generic in cls.__bases__, "Can't specialize non generic type!" # nosec: B101
assert cls.__PARAMETERS__ is None, "Can't specialize already specialized type!" # nosec: B101
assert cls.__TYPE_PARAMETERS__ is None, "Can't specialize already specialized type!" # nosec: B101

type_arguments: tuple[type[Any], ...]
match type_argument:
Expand Down

0 comments on commit c18f245

Please sign in to comment.