summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Announce the move to github in the readme file.HEADmasterClaudiu Popa2015-12-101-64/+5
|
* Some nodes got a new attribute, 'ctx', which tells in which context the said ↵Claudiu Popa2015-12-086-236/+337
| | | | | | | | | | | | | | | | | | | node was used. The possible values for the contexts are `Load` ('a'), `Del` ('del a'), `Store` ('a = 4') and the nodes that got the new attribute are Starred, Subscript, List and Tuple. The builtin ast module provides contexts for Name and Attribute as well, but we took a different approach in the past, by having different nodes for each type of context. For instance, Name used in a Del context is a DelName, while Name used in a Store context is AssignName. Since this is ingrained in astroid since quite some time, it makes no sense to change them as well, even though it's a loss of consistency. The patch introduces a new dependency to enum34 on older Python versions, which is used for building the three possible enum values for the contexts. Closes issue #267.
* relative_to_absolute_name will now raise TooManyLevelsError when a relative ↵Claudiu Popa2015-12-064-0/+35
| | | | import is trying to access something beyond the top-level package.
* AstroidBuildingException is now AstroidBuildingError.Claudiu Popa2015-12-0611-34/+38
| | | | The first name will exist until astroid 2.0.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.Claudiu Popa2015-12-069-49/+63
| | | | | | | | They are subclasses of AstroidBuildingException and are raised when a module can't be imported from various reasons. Also do_import_module lets the errors to bubble up without converting them to InferenceError. This particular conversion happens only during the inference.
* assigned_stmts methods have the same signature from now on.Claudiu Popa2015-12-055-15/+79
| | | | | | | 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.
* Master is now astroid 1.5.0.Claudiu Popa2015-12-031-1/+1
|
* Remove the visit method for AssignAttr in rebuilder, since AssignAttr does ↵Claudiu Popa2015-12-031-8/+0
| | | | not exist as a node in the builtin ast module.
* Don't forget to give credit to the original author.Claudiu Popa2015-12-011-1/+1
|
* Use printf-style formatting in as_string, in orderClaudiu Popa2015-12-013-8/+38
| | | | | | | to avoid a potential problem with encodings when using .format. Closes issue #273.
* Add support for handling Uninferable nodes when calling as_stringClaudiu Popa2015-11-293-0/+19
| | | | | | | | | | Some object, for instance List or Tuple can have, after inference, Uninferable as their elements, happening when their components weren't couldn't be inferred properly. This means that as_string needs to cope with expecting Uninferable nodes part of the other nodes coming for a string transformation. The patch adds a visit method in AsString and ``accept`` on Yes / Uninferable nodes. Closes issue #270.
* Add __delitem__ to deque's brain tip.Claudiu Popa2015-11-261-0/+1
|
* Add __setitem__ to deque's brain tip.Claudiu Popa2015-11-261-0/+1
|
* Merge structured exceptions into masterClaudiu Popa2015-11-2322-280/+570
|\
| * Merge upstream changesCeridwen2015-11-0623-282/+572
| |\
| | * Rename Uninferable and instatiate_classCeridwen2015-11-0623-207/+207
| | |
| | * Use next()'s default argumentCeridwen2015-11-061-4/+3
| | |
| | * Use raise directly rather than reraise() in decorators: reraise in this case ↵Ceridwen2015-11-061-4/+5
| | | | | | | | | | | | only adds noise to the tracebacks on 2.7, and when this code is changed to use yield from, there shouldn't be additional tracebacks on 3 either
| | * Add structured exceptions to decorators and remaining functions.Ceridwen2015-11-065-82/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-032-3/+5
| | |
| | * This bookmark adds structured exceptions to astroid.Ceridwen2015-11-0224-245/+506
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Handle the cases when a List can contain Uninferable as its elementsClaudiu Popa2015-11-236-70/+119
| | | | | | | | | | | | | | | | | | | | | This can happen for instance when the list contains objects which weren't inferable in the first place. There were a bunch of places affected by this bug: unpack_infer, the inference of list additions and the handling of the namedtuple's fields.
* | | With the tox bug fixed, it's now possible to use one tox.ini for all testingCeridwen2015-11-091-8/+2
| | |
* | | Add disable unused-importCeridwen2015-11-061-1/+1
| | |
* | | Uncomment right tox.ini lineCeridwen2015-11-061-2/+2
|/ /
* | Merge upstreamCeridwen2015-11-066-44/+95
|\ \
| * | Fix pylint warnings.Claudiu Popa2015-11-043-36/+38
| | |
| * | Merge bookmark heads.Claudiu Popa2015-11-041-0/+1
| |\ \
| | * | Add __getitem__ method to collections.deque inferface description.Dmitry Pribysh2015-11-041-0/+1
| | | |
| * | | Backout changeset 9c3f71, because it leads to too many false positives when ↵Claudiu Popa2015-11-042-8/+0
| |/ / | | | | | | | | | using .split() in assignment unpacking.
| * | Merge bookmark heads.Claudiu Popa2015-11-043-3/+59
| |\ \
| | * \ Merge @.Claudiu Popa2015-11-021-23/+9
| | |\ \
| | * | | Fix some inconsistencies with accessing the first argument of methodsClaudiu Popa2015-10-313-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | | If the current class is a metaclass (inherits from `type`), then the first argument is always a class, not an instance.
* | | | | Rename Uninferable and instantiate_class, fix broken tests, improveCeridwen2015-11-0625-216/+234
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Fix drone.io lineCeridwen2015-11-021-2/+2
| | | |
* | | | Fix pylint commands lineCeridwen2015-11-021-2/+5
| |/ / |/| |
* | | Merge masterCeridwen2015-11-022-0/+8
|\ \ \ | |/ /
| * | add support for inference on str.split()Laura M?dioni2015-10-302-0/+8
| |/
* | Use conditional deps to simplify tox.iniCeridwen2015-11-021-23/+9
|/
* Merge heads.Claudiu Popa2015-10-302-0/+10
|\
| * Add missing start and shutdown methods to the SyncManager tips.Claudiu Popa2015-10-302-0/+10
| |
* | Update the docstring of object_type in order to make it clearer for its ↵Claudiu Popa2015-10-291-2/+4
|/ | | | actual purpose.
* Rename the brain files again to avoid naming conflicts.Claudiu Popa2015-10-2811-1/+23
|
* Remove trailing whitespace.Claudiu Popa2015-10-261-1/+1
|
* Update docstrings to reflect what's actually happening in some brain files.Claudiu Popa2015-10-262-8/+2
|
* Rename the brain files into something more suggestive. Closes issue #208.Claudiu Popa2015-10-2610-0/+0
|
* Class.getattr('__mro__') returns the actual MRO.Claudiu Popa2015-10-263-6/+34
| | | | | | | | 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.
* Merged in dmand/astroid/fix-list-multiplication (pull request #93)Claudiu Popa2015-10-240-0/+0
|\ | | | | | | Fix inference of list multiplication operation.
* | Use safe_infer for inference of elements in list multiplication operationfix-list-multiplicationDmitry Pribysh2015-10-241-3/+4
| | | | | | | | | | Now inference yields YES instead of list item value when multiple values are inferred for one list item.