summaryrefslogtreecommitdiff
path: root/scoped_nodes.py
Commit message (Collapse)AuthorAgeFilesLines
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-1304/+0
| | | | python setup.py develop now works.
* Use keyword arguments to improve clarity.Claudiu Popa2014-11-041-1/+2
|
* Some parts of the comments weren't true anymore.Claudiu Popa2014-11-041-2/+1
|
* Extend the inference of __all__ elements in wildcard_import_names.Claudiu Popa2014-10-281-1/+6
|
* Module.wildcard_import_names tries to infer non-const entries from __all__.Claudiu Popa2014-10-281-9/+23
|
* Make the source compatible with Python 2.7 and 3.3+.Claudiu Popa2014-10-271-16/+14
|
* Various speed improvements.Claudiu Popa2014-10-201-46/+52
|\ | | | | | | Patch by Alex Munroe.
| * merged with defaultEevee (Alex Munroe)2014-07-311-11/+145
| |\
| * | Fix some deep recursion problems.Eevee (Alex Munroe)2014-07-021-22/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They used to be avoided by returning generators in a few places rather than re-yielding, but I broke that with the context managers. Oops. So: - context.push now returns a new context, which should just be passed into the child generator instead of the original context. This solves the awkward problem of returning a generator from within a `with` block, where the block will end before the generator is actually evaluated. - The inference cache no longer eagerly evaluates whatever's being cached; instead it wraps the original generator in a new one that only caches the results once it's done.
| * | Miscellaneous node rebuilder microoptimizations.Eevee (Alex Munroe)2014-07-011-3/+6
| | |
| * | Speed up rebuilder considerably by computing line numbers lazily.Eevee (Alex Munroe)2014-07-011-14/+18
| | | | | | | | | | | | | | | | | | | | | Fetching the last child of each of hundreds of thousands of nodes is relatively expensive, and most of the time this information is never used, so don't actually figure it out until it's asked for. Saves the overhead of quite a few function calls, too.
| * | Remove context.lookupname; make it an argument to infer() when appropriate.Eevee (Alex Munroe)2014-07-011-24/+21
| | |
| * | Replace copy_context with some dynamic scoping.Eevee (Alex Munroe)2014-07-011-26/+29
| | |
* | | Fix an infinite loop with decorator call chain inference, where the ↵Claudiu Popa2014-10-161-0/+4
| | | | | | | | | | | | decorator returns itself. Closes issue #50.
* | | Guard against infinite recursion in _is_metaclass.Torsten Marek2014-08-221-2/+8
| | | | | | | | | | | | | | | Unfortunately, I wasn't able to boil this down to a small-enough reproduction case, since the case that I had depended on conditional imports.
* | | Fix an infinite loop in the inference, by returning a copy of instance ↵Claudiu Popa2014-08-201-1/+3
| |/ |/| | | | | attributes, when calling 'instance_attr'. Closes issue #34 (patch by Emile Anclin).
* | Fix a crash occurred when inferring decorator call chain. Closes issue #42.Claudiu Popa2014-07-281-1/+1
| |
* | pylint source codeSylvain Thénault2014-07-251-14/+13
| |
* | Return YES if the bases cannot be inferred for a metaclass invocation, until ↵Torsten Marek2014-07-251-1/+5
| | | | | | | | we have an unknown AST node.
* | Function nodes can detect decorator call chain and see if they are decorated ↵Claudiu Popa2014-07-241-1/+50
| | | | | | | | with builtin descriptors (`classmethod` and `staticmethod`).
* | Return new classes when inferring calls to type(name, bases, ns) and its ↵Torsten Marek2014-07-241-1/+24
| | | | | | | | subtypes.
* | Expose function annotation to astroid. `Arguments` node exposes ↵Claudiu Popa2014-07-131-1/+6
| | | | | | | | 'varargannotation', 'kwargannotation' and 'annotations' attributes, while `Function` node has the 'returns' attribute.
* | Make islots private.Claudiu Popa2014-07-031-2/+4
| | | | | | | | | | --HG-- branch : slots
* | Merge with default.Claudiu Popa2014-07-031-8/+25
|\ \ | |/ | | | | | | --HG-- branch : slots
| * Stop looking at the __metaclass__ class attribute for python3Julien Cristau2014-06-301-4/+7
| | | | | | | | Python 3 only considers the `metaclass` keyword argument.
| * Handle __metaclass__ defined at the module levelJulien Cristau2014-06-101-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the doc (https://docs.python.org/2/reference/datamodel.html#customizing-class-creation): The appropriate metaclass is determined by the following precedence rules: - If dict['__metaclass__'] exists, it is used. - Otherwise, if there is at least one base class, its metaclass is used (this looks for a __class__ attribute first and if not found, uses its type). - Otherwise, if a global variable named __metaclass__ exists, it is used. - Otherwise, the old-style, classic metaclass (types.ClassType) is used. The third case was not handled by node.metaclass(). Remove metaclass lookup from the rebuilder, handle it all in Class._explicit_metaclass() instead, and use that in _newstyle_impl if possible. Remove test_newstyle_and_metaclass_bad, as I think the returned value in this test is irrelevant (it's a TypeError anyway, so you can't actually build that class), and replace it with a test using nested classes. Closes issue#33
* | Add `slots` and `islots` methods to Class nodes.Claudiu Popa2014-06-041-2/+54
|/ | | | | --HG-- branch : slots
* Function nodes can detect if they are decorated with subclasses of builtin ↵Claudiu Popa2014-05-071-2/+32
| | | | | | | descriptors when determining their type (`classmethod` and `staticmethod`). --HG-- branch : classmethod_subclasses
* Simplify the lookup for the metaclass; add comments for the YES node tests.Claudiu Popa2014-04-301-6/+4
| | | | | --HG-- branch : ancestors
* Merge with default.Claudiu Popa2014-04-291-0/+4
|\ | | | | | | | | --HG-- branch : ancestors
| * Add future imports to Module.future_imports.Torsten Marek2014-04-251-0/+4
| |
* | Look in ancestors when a class node doesn't use an explicitly defined ↵Claudiu Popa2014-04-251-4/+29
|/ | | | metaclass (the metaclass of a class is a metaclass for all its subclasses).
* Skip non-class bases.Claudiu Popa2014-04-241-0/+2
|
* Skip the same infered nodes as the base class in _is_metaclass. Closes issue ↵Claudiu Popa2014-04-221-0/+2
| | | | | | | #25. --HG-- branch : ancestors
* Add note in test regarding the .ancestors() fix. Check the _type of a base ↵Claudiu Popa2014-04-151-0/+2
| | | | | | | class before calling _is_metaclass again. --HG-- branch : ancestors
* Unwrap instances found in `.ancestors()`, by using their _proxied class. ↵Claudiu Popa2014-04-121-6/+36
| | | | | | | Don't inherit the metaclass status if the current class can't be a metaclass. --HG-- branch : ancestors
* Merged logilab/astroid into defaultClaudiu Popa2014-04-021-0/+8
|\
| * Merged in flyingsheep/astroid (pull request #15)Sylvain Thénault2014-03-261-0/+8
| |\ | | | | | | | | | AstroidBuilder.string_build was incompatible with file_stream
| | * fixed python 2 compatibility for BytesIOPhil Schaf2013-11-251-1/+4
| | |
| | * added file_bytes to Module to allow file_stream to be retrieved from itPhil Schaf2013-11-241-0/+5
| | |
* | | Do not print the traceback for SyntaxErrors.Claudiu Popa2014-04-021-0/+2
|/ /
* | Drop yield_from API, add a new YieldFrom node instead.Claudiu Popa2014-03-041-2/+3
| | | | | | | | | | --HG-- branch : yield_from
* | Use .infer.Claudiu Popa2013-12-181-1/+1
| | | | | | | | | | --HG-- branch : metaclass
* | Add Changelog entry regarding `metaclass`, add a new test for py3k.Claudiu Popa2013-12-181-1/+1
| | | | | | | | | | --HG-- branch : metaclass
* | Add tests.Claudiu Popa2013-08-131-1/+1
| | | | | | | | | | --HG-- branch : metaclass
* | Change metaclass discovery.Claudiu Popa2013-08-131-10/+15
| | | | | | | | | | --HG-- branch : metaclass
* | Return a string depicting the metaclass, not the metaclass itself.Claudiu Popa2013-07-241-1/+4
| |
* | Add support for metaclass for Python 3.Claudiu Popa2013-07-241-1/+4
| |
* | Add metaclass support for Class node.Claudiu Popa2013-07-241-0/+11
|/
* rename all astroid_from* method, introduced by sed, into ast_from*Sylvain Thénault2013-07-241-3/+3
|