diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2016-01-25 00:11:33 +0200 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-01-25 00:11:33 +0200 |
| commit | eb48cf362e413e29c0ddaa7c7d0c88a7db0be95a (patch) | |
| tree | 7f40f39e16ac6625106d3f2c975fe9ee8ab81eb0 | |
| parent | 72eeb62f5fe54b646cd7f733ed3c62e8fc12327c (diff) | |
| download | astroid-git-eb48cf362e413e29c0ddaa7c7d0c88a7db0be95a.tar.gz | |
NodeNG.nearest was removed.
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rw-r--r-- | astroid/tree/base.py | 18 |
2 files changed, 3 insertions, 18 deletions
@@ -3,6 +3,9 @@ Change log for the astroid package (used to be astng) -- + * NodeNG.nearest was removed. It's not an API that we were using + and it was buggy. + * Dict nodes are constructed with two arguments, keys and values, in the same way that ast.Dict is built. diff --git a/astroid/tree/base.py b/astroid/tree/base.py index 43f77d12..755e3b8b 100644 --- a/astroid/tree/base.py +++ b/astroid/tree/base.py @@ -226,24 +226,6 @@ class NodeNG(object): """return the previous sibling statement""" return self.parent.previous_sibling() - def nearest(self, nodes): - """return the node which is the nearest before this one in the - given list of nodes - """ - myroot = self.root() - mylineno = self.fromlineno - nearest = None, 0 - for node in nodes: - assert node.root() is myroot, \ - 'nodes %s and %s are not from the same module' % (self, node) - lineno = node.fromlineno - if node.fromlineno > mylineno: - break - if lineno > nearest[1]: - nearest = node, lineno - # FIXME: raise an exception if nearest is None ? - return nearest[0] - # these are lazy because they're relatively expensive to compute for every # single node, and they rarely get looked at |
