类型注解:在代码中为变量、函数参数、返回值等标明“期望的类型”的写法,用于提高可读性,并帮助类型检查工具发现错误。(在不同语言中用法略有差异;如 Python、TypeScript、Java 等)
She added a type annotation to the function to clarify what it returns.
她给这个函数加了类型注解,以明确它会返回什么。
Without proper type annotations, large codebases become harder to refactor safely, especially when multiple teams collaborate.
如果缺少恰当的类型注解,大型代码库会更难安全地重构,尤其在多团队协作时。
/taɪp ˌænəˈteɪʃən/
type 源自希腊语 typos(“印记、模子”),引申为“类型、范式”;annotation 来自拉丁语 annotare(“做注释、记下”)。合在一起表示“对类型做注释/标注”,在现代编程语境中专指代码里的类型标记。