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.

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

181181 return instance
182182
183183 def __get_container_dependency_or_param(self, parameter: Parameter) -> Any:
184- if parameter.annotation is Parameter.empty:
185- return None
186-
187184 default = parameter.default
188185 # Dealing with parameter, return the value as we cannot proxy int str etc.
189186 if isinstance(default, ParameterWrapper):
192189 return self.__initialize_container_proxy_object_from_parameter(parameter)
193190
194191 def __initialize_container_proxy_object_from_parameter(self, parameter: Parameter) -> Any:
192+ if parameter.annotation is Parameter.empty:
193+ return None
194+
195195 default_val = parameter.default
196196 annotated_type = parameter.annotation
197197

The check that tells the two apart

failpass·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.

Other bugs found in maldoinc/wireup