diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-12 16:43:14 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-12 16:43:14 +0300 |
commit | 2b39c2e00bc56155351df44fb9e7b44443a81742 (patch) | |
tree | a769d9b89bfabf1ffa14fd0f3b7b0a1beb396576 /ChangeLog | |
parent | 35543eb71299989dbf13f2d22ebdba477e879ae0 (diff) | |
download | pylint-2b39c2e00bc56155351df44fb9e7b44443a81742.tar.gz |
Improve the detection of undefined variables in function arguments
This patch involves a lot of subtle changes:
* is_defined_before takes in consideration the fact that its argument
node is a default value for a Lambda / Function.
If it is a default value, then the search is left to the parent of
the lambda. Basically for x in the following, the result of is_defined_before
will be determined by foo:
def foo():
x = 42
func = lambda x=x: x * x
return func
* there's another special rule for undefined-variable which verifies that
a node is used in Arguments.defaults and if the actual definition
is happening before the Arguments statement, basically trying
to understand the following:
class A:
x = 42
foo = lambda x=x: x * x
* undefined variable is emitted if both scope types, for the node
analyzed and for its actual definition, is they are both lambda
scopes.
Closes issue #404.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -118,7 +118,7 @@ ChangeLog for Pylint * Improve the detection of undefined variables and variables used before assignment for variables used as default arguments to function, where the variable was first defined in the class scope. - Closes issue #342. + Closes issue #342 and issue #404. 2015-03-14 -- 1.4.3 |