Opyoid

Latest version: v2.0.2

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

Scan your dependencies

Page 3 of 4

1.0.0

Breaking changes
- Renamed `bound_type` argument in `ClassBinding` and `ItemBinding` constructors into `bound_class`
- Several method signatures now have keyword-only arguments:
- `named` in `Injector.inject`
- `to_class`, `to_instance`, `to_provider`, `scope` and `named` in `AbstractModule.bind`
- `scope`, `named` and `override_bindings` in `AbstractModule.multi_bind`
- `to_class`, `to_instance` and `to_provider` in `AbstractModule.bind_item`
- `scope` and `named` in `ClassBinding.__init__`
- `bound_class`, `bound_instance`, `bound_provider` in `ItemBinding.__init__`
- `named` in `InstanceBinding.__init__`
- `scope`, `named` and `override_bindings` in `MultiBinding.__init__`
- `scope` and `named` in `ProviderBinding.__init__`
- `scope` and `named` in `SelfBinding.__init__`
- `auto_bindings` in `InjectorOptions.__init__`

Features
- Opyoid is now considered stable

0.10.3

Fixes
- Improved error message when missing a named binding, the underlying type and name is used

0.10.2

Fixes
- Improved repr of named types, the original type is now used

0.10.1

Fixes
- Improved repr of generic types, the full name is now used

0.10.0

Breaking changes
- Replaced `annotated_arg` with `named_arg`
- Renamed the `annotation` parameter to `named` in:
- all Binding subclasses
- the `AbstractModule.bind` method
- the `Injector.inject` method
- Changed the way annotated/named arguments work:
- When injecting a parameter in a constructor, opyoid will first try to find a binding with the same type and the
same name as the argument. If none is found, it will then try to find a binding with the same type and no name (this
part did not change).
- If the `named_arg` decorator is used, opyoid will only try to find a binding with this name, if none is found, no
unnamed binding will be used (this did not change).

Features
- Cyclic dependencies now raise a `CyclicDependencyError` instead of a `RecursionError`
- Cleaner and more verbose logs

Fixes
- Removed duplicate logs about registering bindings

0.9.0

Breaking changes
- ClassBindings cannot be used to bind a class to itself anymore, use a SelfBinding instead

Features
- When binding to a target an instance of a subclass of the target type, another InstanceBinding is created with the
same instance and its type as a target
- When binding to a target an instance of a provider, another InstanceBinding is created with the same provider and its
type as a target

Fixes
- Fixed Bindings with a target being overriden by `ClassBindings` with the same target as a `bound_type`

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.