Add a comment about using async funcdefs.

This commit is contained in:
Dave Halter
2017-07-20 17:38:34 +02:00
parent 05f86b9c87
commit 82d69ca211

View File

@@ -25,6 +25,8 @@ class Context(object):
self.parent_context = parent_context
def is_async_funcdef(self):
# Stupidly enough async funcdefs can have two different forms,
# depending if a decorator is used or not.
return self.node.type == 'funcdef' \
and self.node.parent.type in ('async_funcdef', 'async_stmt')