await-outside-async (PLE1142)
源自 Pylint 代码检查工具。
作用
检查在 async 函数外部使用 await 的情况。
为什么这不好?
在 async 函数外部使用 await 是语法错误。
示例
建议改为
Notebook 行为
例外情况是,Jupyter notebook 的顶层允许使用 await(参见:autoawait)。
源自 Pylint 代码检查工具。
检查在 async 函数外部使用 await 的情况。
在 async 函数外部使用 await 是语法错误。
建议改为
例外情况是,Jupyter notebook 的顶层允许使用 await(参见:autoawait)。