mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-11-04 18:07:44 +03:00 
			
		
		
		
	* Add prototype implementation * Implement wiring by string id * Fix pydocstyle errors * Refactor wiring module * Fix flake8 errors * Update changelog * Fix flake8 errors * Add example and docs
		
			
				
	
	
		
			18 lines
		
	
	
		
			356 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			356 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from dependency_injector import containers, providers
 | 
						|
 | 
						|
from .service import Service
 | 
						|
 | 
						|
 | 
						|
class SubContainer(containers.DeclarativeContainer):
 | 
						|
 | 
						|
    int_object = providers.Object(1)
 | 
						|
 | 
						|
 | 
						|
class Container(containers.DeclarativeContainer):
 | 
						|
 | 
						|
    config = providers.Configuration()
 | 
						|
 | 
						|
    service = providers.Factory(Service)
 | 
						|
 | 
						|
    sub = providers.Container(SubContainer)
 |