%E7%BC%96%E7%A8%8B%E7%9B%B8%E5%85%B3/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/Python-Typing-%E7%AC%94%E8%AE%B0 #26
Replies: 1 comment
-
|
concept这块 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
%E7%BC%96%E7%A8%8B%E7%9B%B8%E5%85%B3/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/Python/Python-Typing-%E7%AC%94%E8%AE%B0
最讨厌 python 的动态类型和无声明。 ——鸽子 2025/10/25 typing --- 对类型提示的支持 — Python 3.14.0 文档 所以要写多多标记变量 type,不然在大项目不知道类型就要吃亏。 没有类型提示 写错也没提示 看不懂别人代码 需要知道的是 typing hinting 本质上还是 标注,所以并不是真的会强制进行类型检查,比如说下面的代码实际上可以运行。 def get_text(): a: str = 1 # 虽然标记为 str,但是实际上是 int return a string = get_text() # 调用代码的时候 IDE 类型推导 st...
https://library.whispery.top/%E7%BC%96%E7%A8%8B%E7%9B%B8%E5%85%B3/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/Python/Python-Typing-%E7%AC%94%E8%AE%B0
Beta Was this translation helpful? Give feedback.
All reactions