Usage of containers.override decorator
See original GitHub issueHi, I think in previous versions is was possible to do something like:
containers.override(BaseContainer):
class OverrideContainer: ....
Afterwards
c = BaseContainer()
would contain all the overrides.
However, the typing now complains that containers.override
wants a Container instance and not a class. Has overriding containers on the class level been deprecated, as it also seems to have been removed from the documentation?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Container overriding - Dependency Injector
Decorator @containers.override() takes a container for overriding as an argument. This container providers will be overridden by the providers with the same ...
Read more >python __getattribute__ override and @property decorator
I have some classes which inherit Container base class and some of their methods have @property decorator. class Response(Container): @property ...
Read more >How to Decorate Services (Symfony Docs)
Decoration Priority; Stacking Decorators; Control the Behavior When the Decorated ... When overriding an existing definition, the original service is lost:.
Read more >PEP 698 – Override Decorator for Static Typing
This will allow type checkers to prevent a class of bugs that occur when a base class changes methods that are inherited by...
Read more >Container class - widgets library - Flutter - Dart API docs
A container first surrounds the child with padding (inflated by any borders present in the decoration) and then applies additional constraints to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Done in
4.1.0
.Btw, there are two new providers: https://python-dependency-injector.ets-labs.org/providers/resource.html and https://python-dependency-injector.ets-labs.org/providers/dict.html.
Closing the issue. Comment / re-open if needed.
@rmk135 Yes I believe that “un-deprecating”
@containers.override()
makes probably sense, until we have a better solution. Thanks a lot for going through the discussion!