Whole file
maldoinc/wireup
The author described this change as “Fix case of wiring param without type hint”. It counts as a record because the check below fails on the code as it stood at 9524f5589 and passes on ce7d559cb, with nothing else changed between the two runs.
Projectmaldoinc/wireup
Fix saved2023-09-05
Sharing licenceMIT ·
Change size+3 −3
What the code was meant to do, written into the code itself as a save note
Fix case of wiring param without type hint
The change
| 181 | 181 | return instance | |
| 182 | 182 | ||
| 183 | 183 | def __get_container_dependency_or_param(self, parameter: Parameter) -> Any: | |
| 184 | - | if parameter.annotation is Parameter.empty: | |
| 185 | - | return None | |
| 186 | - | ||
| 187 | 184 | default = parameter.default | |
| 188 | 185 | # Dealing with parameter, return the value as we cannot proxy int str etc. | |
| 189 | 186 | if isinstance(default, ParameterWrapper): | |
| ⋯ | |||
| 192 | 189 | return self.__initialize_container_proxy_object_from_parameter(parameter) | |
| 193 | 190 | ||
| 194 | 191 | def __initialize_container_proxy_object_from_parameter(self, parameter: Parameter) -> Any: | |
| 192 | + | if parameter.annotation is Parameter.empty: | |
| 193 | + | return None | |
| 194 | + | ||
| 195 | 195 | default_val = parameter.default | |
| 196 | 196 | annotated_type = parameter.annotation | |
| 197 | 197 | ||
The check that tells the two apart
fail→pass·test/test_container.py::TestContainer::test_wire_param_without_typing
Check file test/test_container.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it9524f55894609f687808d2a153a04265bd457c63
Broken version dated2023-09-05
Modulewireup.ioc.dependency_container
Units changedDependencyContainer
Fingerprint4b5476b591af511c
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.