Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid global and nonlocal #1356

Closed
orsinium opened this issue Apr 21, 2020 · 1 comment
Closed

Forbid global and nonlocal #1356

orsinium opened this issue Apr 21, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists rule request Adding a new rule

Comments

@orsinium
Copy link
Collaborator

Rule request

Thesis

Forbid global and nonlocal statements usage.

# bad
global a
global a, b
nonlocal a
nonlocal a, b

Reasoning

This is a smell of bad code design that outcomes into hard to track side-effects.

@orsinium orsinium added the rule request Adding a new rule label Apr 21, 2020
@sobolevn
Copy link
Member

Already done!

_forbidden_keywords: ClassVar[AnyNodes] = (
ast.Pass,
ast.Delete,
ast.Global,
ast.Nonlocal,
)

@orsinium orsinium added the duplicate This issue or pull request already exists label Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists rule request Adding a new rule
Projects
None yet
Development

No branches or pull requests

2 participants