Describe the bug
In _apply_parameters (qpi_driver/executors/qblox/config.py), the branch condition contains dead code:
if (
callable(attribute)
and not hasattr(attribute, "__class__") # always False: everything has __class__
or (hasattr(attribute, "__call__") and not isinstance(attribute, (int, float, str, bool)))
):
not hasattr(attribute, "__class__") is always False (every Python object has __class__), so the first clause callable(attribute) and not hasattr(attribute, "__class__") is always False. Via and/or precedence the whole condition collapses to just the second clause. The first two lines are misleading and don't do what they appear to.
To Reproduce
Steps to reproduce the behavior:
- Read
_apply_parameters in qpi_driver/executors/qblox/config.py.
- Evaluate
not hasattr(<any object>, "__class__") → always False.
- Conclude the first clause never contributes to the branch decision.
Expected behavior
The condition should express the intended check without dead sub-expressions. The net runtime behaviour appears correct (it reduces to the second clause), but the first two lines should be removed for clarity. The quantify _apply_parameters is written more cleanly and can serve as a reference.
Screenshots
N/A.
Desktop (please complete the following information):
- OS: N/A (backend Python library bug, platform-independent)
- Browser: N/A
- Version: qpi-driver,
qpi_driver/executors/qblox/config.py (_apply_parameters)
Smartphone (please complete the following information):
- Device: N/A
- OS: N/A
- Browser: N/A
- Version: N/A
Additional context
Severity: Low — code clarity / dead code; no observed behavioural impact.
Describe the bug
In
_apply_parameters(qpi_driver/executors/qblox/config.py), the branch condition contains dead code:not hasattr(attribute, "__class__")is alwaysFalse(every Python object has__class__), so the first clausecallable(attribute) and not hasattr(attribute, "__class__")is alwaysFalse. Viaand/orprecedence the whole condition collapses to just the second clause. The first two lines are misleading and don't do what they appear to.To Reproduce
Steps to reproduce the behavior:
_apply_parametersinqpi_driver/executors/qblox/config.py.not hasattr(<any object>, "__class__")→ alwaysFalse.Expected behavior
The condition should express the intended check without dead sub-expressions. The net runtime behaviour appears correct (it reduces to the second clause), but the first two lines should be removed for clarity. The quantify
_apply_parametersis written more cleanly and can serve as a reference.Screenshots
N/A.
Desktop (please complete the following information):
qpi_driver/executors/qblox/config.py(_apply_parameters)Smartphone (please complete the following information):
Additional context
Severity: Low — code clarity / dead code; no observed behavioural impact.