Repository navigation
0.1.0
This version does a major change to the public API. Now Container is the main object to be used to register types in the container. To resolve, one must uses a ResolutionContext obtained by running open_context() function on the container. This produces a context allowing to resolves types and track entered context managers and cache objects.
Added
factoryregistry decorator now properly register generators decorated with thecontextmanagerdecorator.- Added ability to override container dependencies at scope level using
register_local()function. - Added a function
self()to register a type and use it as its own factory
Removed
- The
Registryobject
Changed
- One must now use objects for lifetimes instead of literals,
Singleton,Contextual,Transient. - Renamed to
lookupthe function to get a binding for a type - Changed the registration API which now use method chaining for registering either value, factory or alias.
- Replaced
ScopewithResolutionContext close()method forContainerandResolutionContexthas been renamed torelease()
Internals
- Registrations has now has a reference to the type to which it is binded
- Extracted the context containaing cached resolved types and entered context managers into a dedicated object which is not tied to
ContainernorResolutionContextdirectly.