Skip to content

Commit c00c40c

Browse files
committed
Update translation: lectures/python_advanced_features.md
1 parent c1b8dbe commit c00c40c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lectures/python_advanced_features.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,14 +582,14 @@ add(1.5, 2.7)
582582

583583
1. **可读性**:类型提示使函数签名具有自文档化效果。读者可以立即了解函数期望的输入类型和返回类型。
584584
2. **编辑器支持**:VS Code 等 IDE 利用类型提示提供更好的自动补全、错误检测和内联文档功能。
585-
3. **错误检查**[mypy](https://mypy.readthedocs.io/)[pyrefly](https://pyrefly.org/) 等工具通过分析类型提示,在*运行代码之前*就能发现错误。
585+
3. **错误检查**[mypy](https://mypy.readthedocs.io/en/stable/)[pyrefly](https://pyrefly.org/) 等工具通过分析类型提示,在*运行代码之前*就能发现错误。
586586
4. **LLM 生成的代码**:大型语言模型经常生成带有类型提示的代码,因此理解其语法有助于阅读和使用它们的输出。
587587

588588
### 科学 Python 中的类型提示
589589

590590
类型提示与 {doc}`性能需求 <need_for_speed>` 的讨论密切相关:
591591

592-
* [JAX](https://jax.readthedocs.io/)[Numba](https://numba.pydata.org/) 等高性能库依赖于了解变量类型来编译快速的机器码。
592+
* [JAX](https://docs.jax.dev/en/latest/)[Numba](https://numba.pydata.org/) 等高性能库依赖于了解变量类型来编译快速的机器码。
593593
* 虽然这些库在运行时推断类型,而不是直接读取 Python 类型提示,但*概念*是相同的——显式的类型信息能够实现优化。
594594
* 随着 Python 生态系统的发展,类型提示与性能工具之间的联系预计将进一步加强。
595595

0 commit comments

Comments
 (0)