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

Two issues with overring functions in the global namespace #330

Closed
pylint-bot opened this issue Sep 11, 2014 · 0 comments · Fixed by #4990
Closed

Two issues with overring functions in the global namespace #330

pylint-bot opened this issue Sep 11, 2014 · 0 comments · Fixed by #4990
Labels
Milestone

Comments

@pylint-bot
Copy link

Originally reported by: Antony Lee (BitBucket: anntzer, GitHub: @anntzer?)


#!python
func1 = None
def func2(): pass

def override_func():
    global func1, func2
    def func1(): pass
    func2 = None

Pylint gives various spurious warnings here in override_func: it does not realize that def func1():... assigns a new value at the global level too, and thinks that there is no previous binding for func2 before overriding it.


DanielNoord added a commit to DanielNoord/pylint that referenced this issue Sep 11, 2021
This checker now also checks function defintions in the module and local scope
This closes pylint-dev#330
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.11.0 milestone Sep 11, 2021
Pierre-Sassoulas added a commit that referenced this issue Sep 11, 2021
* Make ``global-variable-not-assigned`` check local scope
This checker now checks whether the names after the global keyword
are reassigned in the local scope.
This closes #1375

* Make ``global-variable-not-assigned`` check functions
This checker now also checks function defintions in the module and local scope
This closes #330

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* chore: add pre-commit-config to renovate ignore paths

Disable renovate PRs on the .pre-commit-config.yaml which is templated from synthtool. https://docs.renovatebot.com/configuration-options/#ignorepaths

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Mon Mar 15 09:05:39 2021 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 2c54c473779ea731128cea61a3a6c975a08a5378
Source-Link: googleapis/synthtool@2c54c47

Co-authored-by: Christopher Wilcox <crwilcox@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants