@@ -27,7 +27,7 @@ $ pip install py-dependency-injection
2727
2828## Usage:
2929
30- ### Example: Obtaining the Default Dependency Container
30+ #### Obtaining the Default Dependency Container
3131
3232``` python
3333# Retrieve the default container, typically recommended for a single-application setup.
@@ -38,7 +38,7 @@ from dependency_injection.container import DependencyContainer
3838dependency_container = DependencyContainer.get_instance()
3939```
4040
41- ### Example: Obtaining a Second Dependency Container
41+ #### Obtaining a Second Dependency Container
4242
4343``` python
4444# Create additional containers if needed, especially for multi-application scenarios.
@@ -49,7 +49,7 @@ from dependency_injection.container import DependencyContainer
4949a_second_dependency_container = DependencyContainer.get_instance(name = " a_second_dependency_container" )
5050```
5151
52- ### Example: Registering Dependencies
52+ #### Registering Dependencies
5353
5454``` python
5555# Register dependencies with three available scopes: transient, scoped, or singleton.
@@ -59,7 +59,7 @@ dependency_container.register_scoped(AnotherInterface, AnotherClass)
5959dependency_container.register_singleton(ThirdInterface, ThirdClass)
6060```
6161
62- ### Example: Resolving Dependencies
62+ #### Resolving Dependencies
6363
6464``` python
6565# Resolve transient instance (created anew for each call).
@@ -72,7 +72,7 @@ scoped_instance = dependency_container.resolve(AnotherInterface, scope_name="app
7272singleton_instance = dependency_container.resolve(ThirdInterface)
7373```
7474
75- ### Example: Constructor Injection
75+ #### Constructor Injection
7676
7777``` python
7878# Class instances resolved through the container have dependencies injected into their constructors.
@@ -85,7 +85,7 @@ class Foo:
8585 self ._singleton_instance = singleton_instance
8686```
8787
88- ### Example: Method Injection
88+ #### Method Injection
8989
9090``` python
9191# Inject dependencies into instance methods using the `@inject` decorator.
0 commit comments