本文基于 ruff 仓库中 ty 类型检查器的 mdtest 测试文档 semantic_syntax_errors.md ,系统讲解一类容易被忽视的诊断:Python 的“语义级语法错误”。这些语句能被语法解析器完整解析,但违反语言规范,需要在理解作用域、上下文和 Python 版本之后才能判定。读完后你将掌握:每一类 invalid-syntax 诊断的触发 ...
# This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions ...