Skip to content

Commit

Permalink
Relax the RegistryInitConfig type to allow Mapping (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmills authored Jan 23, 2025
1 parent c39ceca commit e82b375
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

# Changelog

## v1.3.0

Relax `RegistryInitConfig` from `Dict` to `Mapping`.

## v1.2.0

Remove workarounds for bugs and incompatibilities in Python 3.7 and 3.8.
Expand Down
2 changes: 1 addition & 1 deletion minject/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, api, path): ...
something = registry['something_i_need']
"""

__version__ = "1.2.0"
__version__ = "1.3.0"

from . import inject
from .inject_attrs import inject_define as define, inject_field as field
Expand Down
8 changes: 4 additions & 4 deletions minject/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Any, Dict, Optional, TypeVar
from typing import TYPE_CHECKING, Any, Mapping, Optional, TypeVar

from typing_extensions import TypedDict

Expand All @@ -11,7 +11,7 @@
T = TypeVar("T")


RegistryInitConfig = Dict[str, Any]
RegistryInitConfig = Mapping[str, Any]


class RegistryConfigWrapper:
Expand All @@ -21,8 +21,8 @@ def __init__(self):
self._impl = {}

def _from_dict(self, config_dict: RegistryInitConfig):
"""Configure the registry from a dictionary.
The provided dictionary should contain general configuration that can
"""Configure the registry from a dictionary-like mapping.
The provided mapping should contain general configuration that can
be accessed using the inject.config decorator.
Parameters:
Expand Down

0 comments on commit e82b375

Please sign in to comment.