Commit faa4139
Zo Bot
remove dead try/except wrapper around mass * acceleration in newtons_second_law_of_motion — the function signature is annotated (mass: float, acceleration: float) -> float, and multiplying two float values cannot raise any exception on valid inputs. The previous 'try: force = mass * acceleration; except Exception: return -0.0' wrapper was dead code that silently masked TypeError when a caller violated the type contract (e.g. passing a string), KeyboardInterrupt, SystemExit, and any unrelated bug in this function body, by returning the unusual signed zero -0.0 which can poison downstream numerical code (-0.0 == 0.0 in equality checks but is distinct in repr and bit pattern). The plain expression makes the implementation match its type signature and its existing doctests; the two doctests still pass (100 and 2.0)
1 parent 234e0e7 commit faa4139
1 file changed
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 74 | + | |
80 | 75 | | |
81 | 76 | | |
82 | 77 | | |
| |||
0 commit comments