mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-20 11:21:18 +08:00
Add a comment about using async funcdefs.
This commit is contained in:
@@ -25,6 +25,8 @@ class Context(object):
|
|||||||
self.parent_context = parent_context
|
self.parent_context = parent_context
|
||||||
|
|
||||||
def is_async_funcdef(self):
|
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' \
|
return self.node.type == 'funcdef' \
|
||||||
and self.node.parent.type in ('async_funcdef', 'async_stmt')
|
and self.node.parent.type in ('async_funcdef', 'async_stmt')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user