DiffDRR
DiffDRR copied to clipboard
Fix walrus operator in assert statement, leading to problems with optimized code
Using the optimization flag -O with the Python interpreter eliminates assert statements. Thus, asserts should have no side-effects.
This small PR moves the inline assignment operator (walrus) out of an assert-statement to make it free of side-effects, so that it can be run in deployments where the -O flag is used.
Change is applied both in the original notebook and exported python module code.