Closed sphuber closed 1 year ago
Patch and project coverage have no change.
Comparison is base (
e5a0ce1
) 90.74% compared to head (e5a0ce1
) 90.74%.:exclamation: Current head e5a0ce1 differs from pull request most recent head bda08b3. Consider uploading reports for the commit bda08b3 to get more accurate results
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Fixes #258
The
if_
andwhile_
conditionals are constructed with a predicate. The interface expects the predicate to be a callable that returns a boolean, which if true, the body of the conditional is entered.The problem is that the type of the value returned by the predicate was not explicitly checked, and any value that would evaluate as truthy would be accepted. This could potentially lead to unexpected behavior, such as an infinite loop for the
while_
construct.Here the
_Conditional.is_true
method is updated to explicitly check the type of the value returned by the predicate. If anything but a boolean is returned, aTypeError
is raised.