pylint-bot / test

0 stars 0 forks source link

.scope() is wrong for some kind of nodes #211

Closed pylint-bot closed 8 years ago

pylint-bot commented 8 years ago

Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?)


For instance, for a default value, astroid will return the function where it is used as its scope, but that's wrong, since the scope is actual the scope of the parent of the function.

#!python

def test(x=f): # the scope of f is test, it should be the scope of the parent of f
    pass

This is also true for the function annotation values.


pylint-bot commented 8 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?):


Working on this in bookmark 2.0.

pylint-bot commented 8 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?):


.scope() returns the proper scope for Arguments's default values, function annotations and comprehensions. Closes issue #211.