Conditions | 3 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | 1 | from typing import List, Type, Union |
|
7 | 1 | def update_container_singletons( |
|
8 | container: Union[ExtendableContainer, WriteableContainer], singletons: List[Type] |
||
9 | ): |
||
10 | 1 | if isinstance(container, ExtendableContainer): |
|
11 | 1 | new_container = container.clone() |
|
12 | else: |
||
13 | new_container = container |
||
14 | 1 | for dep in singletons: |
|
15 | 1 | _define_singleton_in_new_container(new_container, container, dep) |
|
16 | 1 | return new_container |
|
17 | |||
25 |