diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-09-13 16:33:14 -0400 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-09-13 16:33:14 -0400 |
commit | 36795ba6d2d4fd9a06c6145fd5605053fd5b93af (patch) | |
tree | 908b22815e92f11aab05669b5bd90ff075dd6770 /astroid/scoped_nodes.py | |
parent | 41a102e0f4091ed18e607f2580fe5f60233ae8e7 (diff) | |
parent | b094a0d1d4ce9b19c5052aac286f546233d0e0c2 (diff) | |
download | astroid-git-36795ba6d2d4fd9a06c6145fd5605053fd5b93af.tar.gz |
Final draft of state printing after merge
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 .
Diffstat (limited to 'astroid/scoped_nodes.py')
-rw-r--r-- | astroid/scoped_nodes.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py index 2d8a50d1..acdd06a5 100644 --- a/astroid/scoped_nodes.py +++ b/astroid/scoped_nodes.py @@ -954,6 +954,10 @@ class FunctionDef(bases.Statement, Lambda): return True +class AsyncFunctionDef(FunctionDef): + """Asynchronous function created with the `async` keyword.""" + + def _rec_get_names(args, names=None): """return a list of all argument names""" if names is None: |