Skip to content

Commit

Permalink
Refactor _StoreCallSig to inline form
Browse files Browse the repository at this point in the history
While working on python/mypy#16715 I've noticed that `_StoreCallSig` uses class form, while having `__kw` field. This field will be mangled. This is not something typing users want. See python/cpython#129567
  • Loading branch information
sobolevn authored Feb 17, 2025
1 parent 286a6e7 commit b8b9cba
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/hydra_zen/wrapper/_implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,18 +967,18 @@ def get_name(target: _HasName) -> str:
return name


class _StoreCallSig(TypedDict):
"""Arguments for ZenStore.__call__
This default dict enables us to easily update/merge the default arguments for a
specific ZenStore instance, in support of self-partialing behavior."""

name: Union[NodeName, Callable[[Any], NodeName]]
group: Union[GroupName, Callable[[Any], GroupName]]
package: Optional[Union[str, Callable[[Any], str]]]
provider: Optional[str]
__kw: dict[str, Any] # kwargs passed to to_config
to_config: Callable[[Any], Any]
# Arguments for ZenStore.__call__
#
# This default dict enables us to easily update/merge the default arguments for a
# specific ZenStore instance, in support of self-partialing behavior.
_StoreCallSig = TypedDict("_StoreCallSig", [
("name", Union[NodeName, Callable[[Any], NodeName]]),
("group", Union[GroupName, Callable[[Any], GroupName]]),
("package", Optional[Union[str, Callable[[Any], str]]]),
("provider", Optional[str]),
("__kw", dict[str, Any]), # kwargs passed to to_config
("to_config", Callable[[Any], Any]),
])


# TODO: make frozen dict
Expand Down

0 comments on commit b8b9cba

Please sign in to comment.