summaryrefslogtreecommitdiff
path: root/astroid/as_string.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove Python 2 branchesClaudiu Popa2018-10-101-10/+7
|
* Use generators for string joining instead of creating temporary listsClaudiu Popa2018-10-101-16/+16
|
* Initial formatting of astroidClaudiu Popa2018-10-021-173/+210
|
* Reflect AST changes in Python 3.8.Serhiy Storchaka2018-09-301-3/+12
| | | | | | | | * Num, Str, Bytes, Ellipsis and NameConstant are replaced with Constant. (https://bugs.python.org/issue32892) * Index is replaced with its value, ExtSlice is replaced with Tuple. (https://bugs.python.org/issue34822)
* Spelling fixesVille Skyttä2018-07-241-2/+2
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+10
|
* Move operator precedence methods into NodeNGbrendanator2018-07-051-54/+6
|
* Improve as_string output of operators, elif, with, return & docsbrendanator2018-07-051-28/+132
| | | | | | | | | | | | | The precedence and associativity rules of operators are respected and parens are only wrapped around child nodes when needed A single If node inside the else block is output as `elif` Unneccesary parens in with statements are removed Unneccesary parens in tuple returns are removed Doc strings in classes and functions no longer get additional indenting
* Fix useless-object-inheritance lint error (#573)Nick Drozd2018-06-281-1/+1
| | | See https://github.com/PyCQA/pylint/pull/2209
* Remove some code that's always going to be the same now that we run on Python 3Claudiu Popa2018-06-041-6/+2
|
* Add support for asynchronous comprehensions (#400)Łukasz Rogalski2017-03-011-0/+5
| | | Closes #399
* Add support for Python 3.6's annotated assignment nodesrr-2017-02-091-0/+9
|
* Remove occurrences of no-else-return and consider-using-ternaryClaudiu Popa2016-12-181-18/+18
|
* add format string support (#365)Jared Garst2016-10-241-1/+14
| | | Format strings require support for two new nodes, FormattedValue, respectively JoinedStr.
* Fix some pylint errors over the code base.Claudiu Popa2016-08-241-1/+1
|
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+5
|
* 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-0/+4
| | | | | | | | | | 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.
* Use printf-style formatting in as_string, in orderClaudiu Popa2015-12-011-7/+5
| | | | | | | 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-291-0/+3
| | | | | | | | | | 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.
* Fix pylint errors.Claudiu Popa2015-10-061-7/+7
|
* Add a new node, DictUnpack, for representing the unpacking of a dict using ↵Claudiu Popa2015-10-061-3/+14
| | | | | | | | | PEP 448 This is a different approach than what the builtin ast module does, since it just uses None to represent this kind of operation, which seems conceptually wrong, due to the fact the AST contains non-AST nodes. Closes issue #206.
* Make pylint happyy.Claudiu Popa2015-09-251-1/+1
|
* Use the new name of the AsStringVisitor.Claudiu Popa2015-09-181-1/+1
|
* Final draft of state printing after mergeCeridwen2015-09-131-8/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | This patch adds __str__` and `__repr__` methods to InferenceContext and alters the `__str__, `__repr__, and repr_tree() methods for NodeNG. The `__str__` methods print out formatted information about the object's fields; NodeNG's `__str__` method is not recursive. InferenceContext's __repr__` gives a compact representation of its fields. I slightly shortened NodeNG's `__repr__` method by removing a field that's usually empty. I rewrote repr_tree() to better format the information it contains and to display *all* the fields for each AST node, with some fields controlled by options to avoid spam. I also fixed https://bitbucket.org/logilab/astroid/issues/185/as_string-gives-wrong-result-for-keyword .
| * Second pass of the Python 3.5 support: adding Async nodes.Claudiu Popa2015-09-071-0/+13
| |
| * First pass of the Python 3.5 support.Claudiu Popa2015-09-071-8/+6
| |
* | Final draft of improved state printingCeridwen2015-09-131-97/+1
| |
* | First draft of improved state printingCeridwen2015-09-091-47/+100
|/
* Add tests for aliasesCeridwen2015-08-211-5/+5
|
* Merge main into defaultCeridwen2015-08-141-0/+6
|\
| * Add CallFunc.keywords, instead of putting together args and kwargs in ↵Claudiu Popa2015-08-081-0/+6
| | | | | | | | | | | | | | | | | | CallFunc.args This patch improves the similarity with the Python's AST. Until now, CallFunc.args contained both the positional arguments and the keyword arguments, which was misleading and always it was required to filter out keywords when working with arguments.
* | Fix code review comments.Ceridwen2015-07-131-1/+0
| | | | | | | | | | | | | | | | 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-12/+12
|/
* Add annotation support for function.as_string(). Closes issue #37.Claudiu Popa2015-07-011-4/+14
|
* Merged in jarradhope/astroid (pull request #73)Claudiu Popa2015-07-011-2/+5
|\ | | | | | | add annotations to as_string method of Arguments
| * add returns annotationjarradhope2015-04-261-2/+5
| |
* | Add a couple of pragma disables for some false positives.Claudiu Popa2015-06-301-0/+1
| |
* | Add a new *inference object* called SuperClaudiu Popa2015-05-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch also adds support for understanding super calls. astroid understands the zero-argument form of super, specific to Python 3, where the interpreter fills itself the arguments of the call. Also, we are understanding the 2-argument form of super, both for bounded lookups (super(X, instance)) as well as for unbounded lookups (super(X, Y)), having as well support for validating that the object-or-type is a subtype of the first argument. The unbounded form of super (one argument) is not understood, since it's useless in practice and should be removed from Python's specification. Closes issue #89.
* | Add a new type of nodes, called *inference objects*.Claudiu Popa2015-05-191-1/+5
|/ | | | | | | | | | | Inference objects are similar with AST nodes, but they can be obtained only after inference, so they can't be found inside the AST tree. Their purpose is to handle at astroid level some operations which can't be handled when using brain transforms. For instance, the first object added is FrozenSet, which can be manipulated at astroid's level (inferred, itered etc). Code such as this 'frozenset((1,2))' will not return an Instance of frozenset, without having access to its content, but a new objects.FrozenSet, which can be used just as a nodes.Set.
* Extend the metaclass hack to cover more potential cases.Torsten Marek2014-11-091-1/+1
|
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-0/+499
python setup.py develop now works.