summaryrefslogtreecommitdiff
path: root/astroid/mixins.py
Commit message (Collapse)AuthorAgeFilesLines
* Cache the result of get_assign_nodesClaudiu Popa2018-10-101-3/+8
| | | | | | | | The result is usually static, but we're hitting this function quite a lot for big projects such as pandas. This change is a matter of compromising between the amount of memory astroid needs for analysis (e.g. storing the results in memory) vs the wasted CPU time in calling the same function over and over.
* Initial formatting of astroidClaudiu Popa2018-10-021-13/+12
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-1/+6
|
* Fix useless-object-inheritance lint error (#573)Nick Drozd2018-06-281-3/+3
| | | See https://github.com/PyCQA/pylint/pull/2209
* Add NoChildrenMixinNick Drozd2018-06-081-0/+6
| | | | This allows consolidating all the empty get_children methods.
* kill aliases scheduled for removalClaudiu Popa2018-05-241-23/+0
|
* Add MultiLineBlockMixinNick Drozd2018-03-301-0/+35
| | | | | | | | `_multi_line_block_fields` is a list of strings indicating which fields contain multi-line blocks. `_get_multi_line_blocks` dynamically accesses these attributes the first time it is called and then caches the resulting references so as to avoid repeated expensive attribute lookups.
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+4
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
|
* Fix typosJakub Wilk2016-06-021-1/+1
|
* Convert all files to new license headerCeridwen2016-05-161-17/+3
|
* Cleanup pylint's warnings over astroid codebaseClaudiu Popa2015-12-141-1/+0
| | | | | | | | | | Some of the messages were disabled in pylintrc, since they're not very useful for our case. Other parameters, such as the number of arguments / statements / attributes etc were configured so that they won't be too restrictive for our codebase, since making the code to respect them right now requires too much development changes, which is not justified by the end result. Closes issue #284.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.Claudiu Popa2015-12-061-17/+3
| | | | | | | | 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.
* This bookmark adds structured exceptions to astroid.Ceridwen2015-11-021-5/+15
| | | | | | | | | | | | | | | | | | | 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.
* Add helper function for reraising exceptionsCeridwen2015-09-211-12/+4
|
* Use six.reraise to avoid losing tracebacks for simple casesCeridwen2015-09-211-3/+12
|
* Use a stack level of 2 when emitting warnings, since the call site of the ↵Claudiu Popa2015-08-251-3/+3
| | | | deprecated method should be warned upon.
* Add deprecation warnings testsCeridwen2015-08-221-6/+6
|
* Merge main into defaultCeridwen2015-08-141-11/+8
|\
| * Big cleanup across the entire projectClaudiu Popa2015-08-121-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cleanup consisted in a couple of changes: * import only modules, not objects, in order to not clutter the module namespace and to not leak accidentally objects which aren't public API for the said modules. * use two spaces between module level functions * move some mixins from astroid.node_classes in the proper order, starting at the left, not being last in the MRO.
| * Get rid of astroid.common.decorators.Florian Bruhin2015-07-251-2/+1
| | | | | | | | | | | | | | | | This also implements an easier @cache decorator and removes @classproperty as it only was used in an insignificant test. --HG-- branch : no-logilab-common
* | Fix missing warnings importCeridwen2015-07-231-0/+2
| |
* | Merge logilab/astroidCeridwen2015-07-131-1/+2
|\ \ | |/
| * do_import_module passes the proper relative_only flag if the level is higher ↵Claudiu Popa2015-07-141-1/+2
| | | | | | | | | | | | | | | | | | than 1. This has the side effect that using `from .something import something` in a non-package will finally result in an import-error on Pylint's side. Until now relative_only was ignored, leading to the import of `something`, if it was globally available.
* | Fix code review comments.Ceridwen2015-07-131-0/+21
| | | | | | | | | | | | | | | | Added aliases for inferred() and assign_type(), refactor some uses of ternary if, remove some now-unused internal functions in rebuilder, replaced the mutating docstring function with one that returns values as well as side-effects, change back to lazy-object-proxy, and add keyword args to the Module call in rebuilder.
* | Node constructors almost finished except for two bugsCeridwen2015-07-081-5/+5
|/
* Reraise InferenceError with the syntax error that lead to a failed ↵Claudiu Popa2015-03-181-1/+3
| | | | do_import_module call.
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-0/+124
python setup.py develop now works.