summaryrefslogtreecommitdiff
path: root/astroid/scoped_nodes.py
Commit message (Collapse)AuthorAgeFilesLines
* relative_to_absolute_name will now raise TooManyLevelsError when a relative ↵Claudiu Popa2015-12-061-0/+4
| | | | import is trying to access something beyond the top-level package.
* AstroidBuildingException is now AstroidBuildingError.Claudiu Popa2015-12-061-2/+2
| | | | The first name will exist until astroid 2.0.
* assigned_stmts methods have the same signature from now on.Claudiu Popa2015-12-051-0/+1
| | | | | | | They used to have different signatures and each one made assumptions about what could be passed to other implementations, leading to various possible crashes when one or more arguments weren't given. Closes issue #277.
* Merge upstream changesCeridwen2015-11-061-59/+67
|\
| * Rename Uninferable and instatiate_classCeridwen2015-11-061-19/+19
| |
| * Use next()'s default argumentCeridwen2015-11-061-4/+3
| |
| * Add structured exceptions to decorators and remaining functions.Ceridwen2015-11-061-34/+30
| | | | | | | | | | | | | | | | | | | | * Use explicit StopIteration to pass information from generators to raise_if_nothing_inferred and path_wrapper, rather than return or implicit termination by reaching the end of the code block. * Remove remove_nodes in favor of handling the cases in local_attr, istance_attr, and getattr, to avoid the need for complicated information passing when needing to raise an exception.
| * Improve InferenceError for remove_nodesCeridwen2015-11-031-1/+1
| |
| * Improve InferenceError for remove_nodesCeridwen2015-11-031-3/+4
| |
| * This bookmark adds structured exceptions to astroid.Ceridwen2015-11-021-31/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major changes: * AstroidError has an __init__ that accepts arbitrary keyword-only arguments for adding information to exceptions, and a __str__ that lazily uses exception attributes to generate a message. The first positional argument to an exception is assigned to .message. The new API should be fully backwards compatible in general. * Some exceptions are combined or renamed; the old names are still available. * The OperationErrors used by pylint are now BadOperationMessages and located in util.py. * The AstroidBuildingException in _data_build stores the SyntaxError in its .error attribute rather than args[0]. * Many places where exceptions are raised have new, hopefully more useful error messages. The only major issue remaining is how to propagate information into decorators.
* | Merge upstreamCeridwen2015-11-061-33/+35
|\ \
| * | Fix pylint warnings.Claudiu Popa2015-11-041-33/+35
| |/
* | Rename Uninferable and instantiate_class, fix broken tests, improveCeridwen2015-11-061-19/+26
|/ | | | | | | | | | | testing. * Rename YES to Uninferable * Rename instanciate_class to instantiate_class. * Use six in test_namedtuple_advanced_inference. * Fix test_file_from_module failure on PyPy. * Add enum34 to unittest_brain. * Add unittest_brain dependencies tox.ini.
* Class.getattr('__mro__') returns the actual MRO.Claudiu Popa2015-10-261-6/+8
| | | | | | | | Also, Class.getattr('__bases__') returns actual bases. It previously didn't work correctly, because it was putting the entire ancestors into the Tuple object and it put those classes into the wrong attribute. Closes issue #128.
* Move proxy_alias function to util.pyClaudiu Popa2015-10-111-3/+3
|
* Remove doctype and future imports which aren't useful.Claudiu Popa2015-10-111-2/+0
|
* Move bases.NodeNG and bases.Statement in node_classesClaudiu Popa2015-10-111-4/+6
| | | | | | We're doing this in order to reduce the dependency hell which occurs when a module such as bases.py wants to use classes defined in node_classes.
* Fix a crash which occurred when extra_decorators was considering non-class ↵Claudiu Popa2015-09-291-1/+4
| | | | level assignments to the same name as decorator calls.
* Merged in ceridwenv/astroid (pull request #88)Claudiu Popa2015-09-261-7/+5
|\ | | | | | | Use six.reraise to avoid losing tracebacks for simple cases
| * Add helper function for reraising exceptionsCeridwen2015-09-211-13/+4
| |
| * Use six.reraise to avoid losing tracebacks for simple casesCeridwen2015-09-211-7/+14
| |
* | Allow only classes to be looked up in the metaclass chain for searching for ↵Claudiu Popa2015-09-221-1/+1
|/ | | | an attribute.
* Final draft of state printing after mergeCeridwen2015-09-131-12/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | This patch adds __str__` and `__repr__` methods to InferenceContext and alters the `__str__, `__repr__, and repr_tree() methods for NodeNG. The `__str__` methods print out formatted information about the object's fields; NodeNG's `__str__` method is not recursive. InferenceContext's __repr__` gives a compact representation of its fields. I slightly shortened NodeNG's `__repr__` method by removing a field that's usually empty. I rewrote repr_tree() to better format the information it contains and to display *all* the fields for each AST node, with some fields controlled by options to avoid spam. I also fixed https://bitbucket.org/logilab/astroid/issues/185/as_string-gives-wrong-result-for-keyword .
| * Final draft of improved state printingCeridwen2015-09-131-6/+4
| |
| * First draft of improved state printingCeridwen2015-09-091-7/+10
| |
* | First pass of the Python 3.5 support.Claudiu Popa2015-09-071-0/+4
|/
* Merged in ceridwenv/astroid (pull request #86)Claudiu Popa2015-08-261-7/+15
|\ | | | | | | Improve decorator introspection using wrapt and functools.wraps.
| * Make seen a parameter with a default value, instead of passing explicitly None.Claudiu Popa2015-08-261-2/+2
| |
| * Merged in renezhang/astroid_metaclass_loop (pull request #85)Claudiu Popa2015-08-261-7/+15
| |\ | | | | | | | | | Fix infinite loop in metaclass inference
| | * Add new _find_metaclass method to maintain signature of metaclassRene Zhang2015-08-261-8/+11
| | |
| | * Fix infinite loop in metaclass inferenceRene Zhang2015-08-201-4/+9
| | |
* | | Improve decorator introspection using wrapt and functools.wrapsCeridwen2015-08-261-9/+7
|/ /
* | Change the order of the mixins, so that mixins are the first in the MRO ↵Claudiu Popa2015-08-251-2/+2
| | | | | | | | before the actual roots.
* | Fix pylint issues.Claudiu Popa2015-08-251-3/+2
| |
* | Use the old display types, since they are used by pylint to generate error ↵Claudiu Popa2015-08-221-2/+2
| | | | | | | | messages.
* | Remove debug statementsCeridwen2015-08-211-1/+0
| |
* | Add tests for aliasesCeridwen2015-08-211-8/+10
| |
* | More fixes for bugs introduced during mergeCeridwen2015-08-181-17/+24
| |
* | More code review fixesCeridwen2015-08-151-18/+3
| |
* | Fix most obvious errors intorduced by the latest mergeCeridwen2015-08-141-8/+2
| |
* | Merge main into defaultCeridwen2015-08-141-93/+201
|\ \ | |/
| * Move InferenceContext and CallContext into astroid.contextClaudiu Popa2015-08-121-5/+6
| | | | | | | | | | | | | | In order to reduce circular dependencies between components, CallContext is moved into a new module, astroid.context. At the same time, for increasing the cohesion inside astroid.bases, InferenceContext was moved as well into astroid.context.
| * Remove unused imports.Claudiu Popa2015-08-111-1/+0
| |
| * Drop code that inspects sys.modules unconditionally, since it breaks the ↵Claudiu Popa2015-08-091-13/+0
| | | | | | | | expectancy of a static analysis tool.
| * Remove dead code.Claudiu Popa2015-08-091-1/+0
| |
| * Move YES to astroid.util.Claudiu Popa2015-08-091-14/+15
| | | | | | | | | | | | | | YES is needed by other components of astroid, components which aren't necessarily related to astroid.bases. In order to reduce circular interdependencies between components, YES is moved into a new module, tailored for various *utilities*.
| * Remove trailing whitespaces.Claudiu Popa2015-08-061-3/+3
| |
| * Move the determination of extra_decorators directly into Function, as ↵Claudiu Popa2015-08-061-2/+42
| | | | | | | | | | | | | | | | | | | | Function.extra_decorators. Previously, the extra_decorators computation was done in the rebuilder, which isn't the proper way to do it, since the rebuilder should be responsible only from transforming vanilla ast trees to astroid trees. Now, Function exports a propery called `extra_decorators`, which computes at runtime the callables that are wrapping a function in a class scope.
| * Move the determination of a function type from rebuilder to Function.type.Claudiu Popa2015-08-061-46/+53
| | | | | | | | Closes issue #162.
| * Class._explicit_metaclass is now a public API, in the form of ↵Claudiu Popa2015-08-041-7/+6
| | | | | | | | | | | | | | | | Class.declared_metaclass. Class.mro remains the de facto method for retrieving the metaclass of a class, which will also do an evaluation of what declared_metaclass returns.