You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using any nonzero `-O` level with mpy-cross causes Python `assert` statements to not be included.
This is not compatible with the way that wiznet5k uses assert statements, because it depends on the assert statement's expression being evaluated for correct operation. For example,
assertself._w5100_init() ==1, "Failed to initialize WIZnet module."
Because Adafruit's circuitpython-build-tools never specify a -O level, this problem will not affect mpy files we generate or ship to users.
However, fixing the way asserts are used (probably by replacing them with a variation on if not condition: raise RuntimeError("message") in the case where the side-effect of the expression is required) would be welcome from contributors.
If you agree with this analysis, I recommend either re-titling and updating the initial comment on this issue, or closing it and opening a fresh one to reflect the conclusion.
This is not compatible with the way that wiznet5k uses assert statements, because it depends on the assert statement's expression being evaluated for correct operation. For example,
Because Adafruit's circuitpython-build-tools never specify a
-O
level, this problem will not affect mpy files we generate or ship to users.However, fixing the way asserts are used (probably by replacing them with a variation on
if not condition: raise RuntimeError("message")
in the case where the side-effect of the expression is required) would be welcome from contributors.If you agree with this analysis, I recommend either re-titling and updating the initial comment on this issue, or closing it and opening a fresh one to reflect the conclusion.
Originally posted by @jepler in #67 (comment)
The text was updated successfully, but these errors were encountered: