diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2016-01-24 23:20:42 +0200 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-01-24 23:20:42 +0200 |
| commit | 72eeb62f5fe54b646cd7f733ed3c62e8fc12327c (patch) | |
| tree | 2c3ffdb0f20fe421f0bcda98a7c8e23a30b25d09 | |
| parent | c71e16725af822b3b96e0417ad087b33931273d0 (diff) | |
| download | astroid-git-72eeb62f5fe54b646cd7f733ed3c62e8fc12327c.tar.gz | |
Clarify why we are sorting locals.
| -rw-r--r-- | astroid/interpreter/lookup.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/astroid/interpreter/lookup.py b/astroid/interpreter/lookup.py index d8e5931a..b47c1193 100644 --- a/astroid/interpreter/lookup.py +++ b/astroid/interpreter/lookup.py @@ -287,7 +287,9 @@ def locals_import_from(node, locals_): # Don't add future imports to locals. if node.modname == '__future__': return - # Inherited code, I don't know why this function sorts this list. + + # Sort the list for having the locals ordered by their first + # appearance. def sort_locals(my_list): my_list.sort(key=lambda node: node.fromlineno) |
