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

Fail to find NameError for undefined functions #1144

Closed
kolokoltsov opened this issue Oct 23, 2016 · 2 comments · Fixed by #8494 or #9093
Closed

Fail to find NameError for undefined functions #1144

kolokoltsov opened this issue Oct 23, 2016 · 2 comments · Fixed by #8494 or #9093
Labels
Bug 🪲 C: used-before-assignment Issues related to 'used-before-assignment' check False Negative 🦋 No message is emitted but something is wrong with the code
Milestone

Comments

@kolokoltsov
Copy link

kolokoltsov commented Oct 23, 2016

Steps to reproduce

run pylint on code:

# coding=utf-8
print(calculate(1.01, 2))

def calculate(value1: int, value2: float) -> int:
    return (value1+value2)

Current behavior

Error is not issued.

Expected behavior

E: nn, nn: Undefined function 'calculate' (undefined-function)

pylint --version output

pylint.EXE 1.6.4,
astroid 1.4.8
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)]

@PCManticore
Copy link
Contributor

I can confirm the bug, thank you.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jun 29, 2022
@clavedeluna
Copy link
Collaborator

This is very much related to used-before-assignment

print(hello)
hello = "hi"

but since it's related to functions, I guess we need a new checker for undefined-function / class, etc? Or can this fit into a currently existing msg?

@Pierre-Sassoulas Pierre-Sassoulas added Needs specification 🔐 Accepted as a potential improvement, and needs to specify edge cases, message names, etc. and removed Needs PR This issue is accepted, sufficiently specified and now needs an implementation labels Nov 5, 2022
@jacobtylerwalls jacobtylerwalls added C: used-before-assignment Issues related to 'used-before-assignment' check False Negative 🦋 No message is emitted but something is wrong with the code labels Mar 26, 2023
@jacobtylerwalls jacobtylerwalls modified the milestones: 2.17.2, 3.0.0 Mar 26, 2023
@jacobtylerwalls jacobtylerwalls removed Hacktoberfest Needs specification 🔐 Accepted as a potential improvement, and needs to specify edge cases, message names, etc. labels Mar 26, 2023
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0, 3.0.0b1, 3.0.0a7 Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 C: used-before-assignment Issues related to 'used-before-assignment' check False Negative 🦋 No message is emitted but something is wrong with the code
Projects
None yet
6 participants