We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A bug type I've come across myself has been with forgetting to use the global keyword with global variables. Here's an example:
global
# A globally accessible list current_labels = [] def reset_current_labels(): """ Clears the label list """ current_labels = []
The bug is that calling reset_current_labels() will not modify current_labels:
reset_current_labels()
>>> current_labels.append('delete me') >>> current_labels ['delete me'] >>> reset_current_labels() >>> current_labels ['delete me']
The correct code would be
# A globally accessible list current_labels = [] def reset_current_labels(): """ Clears the label list """ global current_labels current_labels = []
So to bug the code, you would remove one or more global statements.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion, would this script satisfy your example ? (some of the bugs are unchecked and might not work )
OpenBugger/logic/logic_injector.py
Line 401 in 3b0a6e5
Sorry, something went wrong.
Almost. I think to reproduce the bug, the entire global declaration should be missing.
No branches or pull requests
A bug type I've come across myself has been with forgetting to use the
global
keyword with global variables. Here's an example:The bug is that calling
reset_current_labels()
will not modify current_labels:The correct code would be
So to bug the code, you would remove one or more
global
statements.The text was updated successfully, but these errors were encountered: