Skip to content

Commit a9090a2

Browse files
committed
Update README a bit.
1 parent 0191241 commit a9090a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $ pip install py-dependency-injection
2929

3030
The following examples demonstrates how to use the library.
3131

32-
#### Example: Obtaining the Default Dependency Container
32+
### Example: Obtaining the Default Dependency Container
3333

3434
```python
3535
# Retrieve the default container, typically recommended for a single-application setup.
@@ -40,7 +40,7 @@ from dependency_injection.container import DependencyContainer
4040
dependency_container = DependencyContainer.get_instance()
4141
```
4242

43-
#### Example: Obtaining a Second Dependency Container
43+
### Example: Obtaining a Second Dependency Container
4444

4545
```python
4646
# Create additional containers if needed, especially for multi-application scenarios.
@@ -51,7 +51,7 @@ from dependency_injection.container import DependencyContainer
5151
a_second_dependency_container = DependencyContainer.get_instance(name="a_second_dependency_container")
5252
```
5353

54-
#### Example: Registering Dependencies
54+
### Example: Registering Dependencies
5555

5656
```python
5757
# Register dependencies with three available scopes: transient, scoped, or singleton.
@@ -61,7 +61,7 @@ dependency_container.register_scoped(AnotherInterface, AnotherClass)
6161
dependency_container.register_singleton(ThirdInterface, ThirdClass)
6262
```
6363

64-
#### Example: Resolving Dependencies
64+
### Example: Resolving Dependencies
6565

6666
```python
6767
# Resolve transient instance (created anew for each call).
@@ -74,7 +74,7 @@ scoped_instance = dependency_container.resolve(AnotherInterface, scope_name="app
7474
singleton_instance = dependency_container.resolve(ThirdInterface)
7575
```
7676

77-
#### Example: Constructor Injection
77+
### Example: Constructor Injection
7878

7979
```python
8080
# Class instances resolved through the container have dependencies injected into their constructors.
@@ -87,7 +87,7 @@ class Foo:
8787
self._singleton_instance = singleton_instance
8888
```
8989

90-
#### Example: Method Injection
90+
### Example: Method Injection
9191

9292
```python
9393
# Inject dependencies into instance methods using the `@inject` decorator.

0 commit comments

Comments
 (0)