def process_parentheses(token, previous_token):
if token.string == '(':
is_function = (
previous_token and
(
(previous_token.string in CLOSE_ATOM_STRINGS) or
(
previous_token.type == mod_token.NAME and
previous_token.string not in ALL_KWDS
)
)
)
if is_function:
tk_string = previous_token.string
if tk_string in NOT_PYTHON_2_KWDS:
return [PY2_ONLY_ERROR]
if tk_string in NOT_PYTHON_3_KWDS:
return [PY3K_ONLY_ERROR]
else:
return [TUPLE_OR_PARENTH_FORM]
return [True]
评论列表
文章目录