summaryrefslogtreecommitdiff
path: root/astroid/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright noticehippo912021-02-151-0/+1
|
* New copyright noticeshippo912020-12-271-0/+1
|
* Squash one-off inference utility functions to help reduce recursion errors ↵Bryce Guinta2020-06-221-24/+0
| | | | | | (#804) This also makes debugging a lot simpler reducing the complexity of the function stack.
* YES is gone, we're using Uninferable for quite some time nowClaudiu Popa2018-10-101-4/+0
|
* Initial formatting of astroidClaudiu Popa2018-10-021-16/+28
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+4
|
* Limit inference to a maximum of 100 results at a time to preventBryce Guinta2018-07-061-0/+24
| | | | | | | | | | spot performance issues. Add new envrionment variable call ASTROID_MAX_INFERABLE to tune the max inferable amount of values at a time. Close #579 Close PyCQA/pylint#2251
* Fix useless-object-inheritance lint error (#573)Nick Drozd2018-06-281-2/+2
| | | See https://github.com/PyCQA/pylint/pull/2209
* Fix lint errorsClaudiu Popa2018-05-311-2/+0
|
* Remove reraise() in favour of using raise..fromClaudiu Popa2018-05-311-7/+0
|
* Remove six from a couple of filesClaudiu Popa2018-05-311-0/+1
|
* Fix the remaining lint errorsClaudiu Popa2017-10-121-0/+1
|
* Don't crash when getting the string representation of BadUnaryOperationMessageClaudiu Popa2017-07-081-1/+22
| | | | | | | | In some cases, when the operand does not have a .name attribute, getting the string representation of a BadUnaryOperationMessage leads to a crash. Close PyCQA/pylint#1563
* 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
|
* Introduce a special attributes modelClaudiu Popa2016-06-031-0/+13
| | | | | | | | 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.
* Convert all files to new license headerCeridwen2016-05-161-17/+3
|
* Add support for handling Uninferable nodes when calling as_stringClaudiu Popa2015-11-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.
* 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.
* 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*.