summaryrefslogtreecommitdiff
path: root/astroid/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Simplify an if expression.Claudiu Popa2016-08-241-1/+1
|
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-6/+3
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
|
* Make Uninferable have a false value by default.Claudiu Popa2016-07-161-0/+5
|
* Convert all files to new license headerCeridwen2016-05-171-17/+3
|
* Introduce a special attributes modelClaudiu Popa2016-02-231-0/+7
| | | | | | | | Through this model, astroid starts knowing special attributes of certain Python objects, such as functions, classes, super objects and so on. This was previously possible before, but now the lookup and the attributes themselves are separated into a new module, objectmodel.py, which describes, in a more comprehensive way, the data model of each object.
* Revert "Try to solve the packaging issues again"Claudiu Popa2016-02-111-0/+160
| | | | This reverts commit d37b81de4f1e64abc2f222c487785d816ab469ea.
* Try to solve the packaging issues againCeridwen2016-02-081-160/+0
|
* Add support for handling Uninferable nodes when calling as_stringClaudiu Popa2015-12-291-0/+6
| | | | | | | | | | 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 a workaround for singledispatch raising AttributeError on old-style classesCeridwen2015-11-161-2/+16
|
* Merge modular-locals into 2.0Ceridwen2015-11-161-4/+21
|\
| * Merge master and structured_exceptionsCeridwen2015-11-061-0/+4
| |\
| * | Rename Uninferable and instantiate_classCeridwen2015-11-061-2/+2
| | |
| * | Fix not returning function arguments correctly in get_locals and how ↵Ceridwen2015-11-031-2/+0
| | | | | | | | | | | | EmptyNodes are constructed in ast_from_object
| * | Merge structured_exceptions into modular-localsCeridwen2015-11-021-0/+35
| |\ \
| * | | Transfer build_function and ast_from_function from modular_locals to zipperCeridwen2015-10-231-4/+16
| | | |
| * | | Merge upstream changesCeridwen2015-10-111-0/+2
| |\ \ \
| * | | | Use namedtuple template for its inferred representation, fix some testsCeridwen2015-10-111-0/+18
| | | | |
| * | | | Handle assigning instance_attrs on ClassDefs through Instances, bug fixesCeridwen2015-10-101-1/+2
| | | | |
| * | | | Add lazy importsCeridwen2015-10-081-24/+5
| | | | |
| * | | | Example of unclear ImportErrorCeridwen2015-10-081-0/+26
| | | | |
* | | | | Merge structured exceptions into 2.0Claudiu Popa2015-11-131-0/+35
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Merge upstream changesCeridwen2015-11-061-0/+4
| |\ \ \ \
| | * | | | Rename Uninferable and instantiate_class, fix broken tests, improveCeridwen2015-11-061-2/+6
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Rename Uninferable and instatiate_classCeridwen2015-11-061-2/+2
| | |_|/ | |/| |
| * | | This bookmark adds structured exceptions to astroid.Ceridwen2015-11-021-0/+35
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Rename Uninferable and instantiate_class, fix broken tests, improveCeridwen2015-11-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Move singledispatch import into a common place, where it can be used by astroid.Claudiu Popa2015-11-011-0/+5
| | |
* | | Start splitting AST from runtime objectsClaudiu Popa2015-11-011-0/+12
|/ / | | | | | | | | | | There are two new directories now, runtime and tree, which are meant to separate between runtime objects, such as Instance, BoundMethod etc from AST nodes.
* | Move proxy_alias function to util.pyClaudiu Popa2015-10-111-0/+21
|/
* Use the object.__new__ decorator to create a singleton instance of the YES ↵Claudiu Popa2015-09-261-5/+3
| | | | object.
* Add helper function for reraising exceptionsCeridwen2015-09-211-0/+11
|
* Move YES to astroid.util.Claudiu Popa2015-08-091-0/+38
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*.