feature request: provider for "self"
See original GitHub issueI would like a provider to be able to pass a container as an argument:
class Container(containers.DeclarativeContainer):
foo = providers.Callable(calc_foo, containers.MarkerForContainer)
bar = providers.Object('hello')
container = Container()
container.override_providers(container=container)
def calc_foo(container):
print(container.bar())
container.foo() # prints "hello" - ?
I assume that is impossible to do directly, right now? I guess perhaps I could do:
class Container(containers.DeclarativeContainer):
container = providers.DependenciesContainer()
foo = providers.Callable(calc_foo, container)
bar = providers.Object('hello')
container = Container()
container.override_providers(container=container)
def calc_foo(container):
print(container.bar())
container.foo() # prints "hello" - ?
But having the container work without having to put cheese in it (to use a mousetrap analogy) would be great… any chance of something like the former (if indeed it isn’t possible)?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
How to Collect and Manage Feature Requests in SaaS
In this article, we'll cover several methods for collecting and managing feature requests to meet customer expectations for your SaaS.
Read more >Feature Requests: What are they and how to manage them
Feature requests are a form of product feedback you may frequently encounter as a SaaS product manager. They typically come in the form...
Read more >Feature-Request - au2mator - Self Service Portal
#FEATURE REQUEST. Tell us what you want to see next at au2mator – Self Service Portal or vote on a Feature Request.
Read more >How To Manage Feature Requests [Template included]
This guide will teach you everything about feature requests – how to process them, manage them, respond to them, prioritize them – so...
Read more >Feature Request Template: How to Manage Suggestions at ...
A feature request is a user's attempt at coming up with a solution to a problem they encountered while using your product. As...
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 FreeTop 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
Top GitHub Comments
@shaunc Closing this issue. Let me know if you have any questions.
Thanks @shaunc