Injector

Latest version: v0.22.0

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.18.3

------

- Fixed Python 3.5.3 compatibility

0.18.2

------

- Added remaining type hints to the codebase so that the client code can have better static typing safety
- Fixed UnsatisfiedRequirement string representation (this time for real)
- Added forward return type reference support to provider methods

0.18.1

------

- Fixed UnsatisfiedRequirement instantiation (trying to get its string representation would fail)
- Fixed injecting a subclass of a generic type on Python versions older than 3.7.0
- Fixed regression that caused BoundKey injection failure

0.18.0

------

- Added new public :func:`get_bindings <injector.get_bindings>` function to see what parameters will be injected
into a function
- Added new generic types using a draft implementation of `PEP 593 <https://www.python.org/dev/peps/pep-0593/>`_:
:data:`Inject <injector.Inject>` and :data:`NoInject <injector.NoInject>`. Those serve as additional ways to
declare (non)injectable parameters while :func:`inject <injector.inject>` won't go away any time soon
:func:`noninjectable <injector.noninjectable>` may be removed once `NoInject` is cofirmed to work.

Backwards incompatible:

- Removed previously deprecated `Key`, `BindingKey`, `SequenceKey` and `MappingKey` pseudo-types

0.17.0

------

- Added support for using `typing.Dict` and `typing.List` in multibindings. See :meth:`multibind <injector.Binder.multibind>`.
- Added multibinding-specific :func:`provider <injector.provider>` variant: :func:`multiprovider <injector.multiprovider>`
- Deprecated using :func:`provider <injector.provider>` for multibindings
- Fixed failure to provide a default value to a `NewType`-aliased type with auto_bind enabled
- Deprecated :func:`Key <injector.Key>`, :func:`SequenceKey <injector.SequenceKey>` and
:func:`MappingKey <injector.MappingKey>` – use real types or type aliases instead
- Deprecated using single-item lists and dictionaries for multibindings - use real types or type aliases instead

Technically backwards incompatible:

- typing.List and typing.Dict specializations are now explicitly disallowed as :meth:`bind <injector.Binder.bind>`
interfaces and types returned by :func:`provider <injector.provider>`-decorated methods

0.16.2

------

- (Re)added support for decorating classes themselves with :func:`inject <injector.inject>`. This is the same
as decorating their constructors. Among other things this gives us
`dataclasses <https://docs.python.org/3/library/dataclasses.html>`_ integration.

Page 2 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.