CodeQL 文档

使用‘apply’ 函数

ID: py/use-of-apply
Kind: problem
Security severity: 
Severity: warning
Precision: very-high
Tags:
   - maintainability
Query suites:
   - python-security-and-quality.qls

点击查看 CodeQL 仓库中的查询

‘apply’ 函数已弃用,并且使代码难以阅读,因为大多数 Python 程序员不熟悉它(它已于 2003 年弃用)。

建议

apply(function, args) 替换为 function(*args)

apply(function, args, keywords) 替换为 function(*args, **keywords)

参考

  • ©GitHub, Inc.
  • 条款
  • 隐私