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