Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Declare global variables that are created elsewhere#10689
New issue
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@tacaswell@anntzer Your review of this approach? |
anntzer left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It's kind of funny that this placates flake8 but I guess the point is that it cannot know all the places where a global could be introduced. I think it's a reasonable compromise.
Given that the global declaration is notactually needed, I'd make the comment more explicit: "...; declaration placates pyflakes" (something like that) (otherwise someone could just remove it at some point thinking it's redundant)
Comments updated as requested. |
Fixes#10502
PR Summary
Declareshow andFigureManager as global variables because they are created by an _@Backend.export decorator at the bottom or each file. Theglobal declaration and associated comment helps both humans and linters make sense of this non-intuitive situation.
PR Checklist