Skip to content

Commit d2a764b

Browse files
committed
Change design of README.
1 parent 16e6868 commit d2a764b

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
@@ -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
3838
dependency_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
4949
a_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)
5959
dependency_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
7272
singleton_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

Comments
 (0)