Indentation in Python can cause unfriendly errors #2055
Labels
enhancement
Enhancement of existing feature
good first issue
Good for newcomers
python
Related to the Python target
It may not be worth much effort to fix this, but the following program generates Python that will not execute:
The problem is that the comment is indented less than the code in the reaction body, which is apparently allowed in Python, but the code generator appends a
return 0
statement to the generated reaction body, which looks like this:It's not clear to me why a return value is needed for reactions in the Python target. This seems problematic anyway. The following code works correctly without any return value having been specified:
Maybe the return statement is not needed?
If this is the case, it could just be removed from
generatePythonFunction
inPythonReactionGenerator.java
.The text was updated successfully, but these errors were encountered: