语言核心
类型与数据模型
并发与异步
底层与性能
工程与综合
生态与收官
10-type-annotations-mypy
10-type-annotations-mypy/02-mypy-catches/before.py.txt
text · 0.2 KB
"""strict 之前:缺注解,且有一处赋值类型不匹配。""" def total(values): result = 0 for value in values: result += value return result def parse(text: str) -> int: value: int = text return value
该文件由构建期采集,未做任何改写;源码页不进入搜索引擎索引。