来源:Mypy
浏览 365
扫码
分享
2020-04-13 20:28:05
Additional notes
- You should include types for arguments with default values in theannotation. The
opt
argument of method
in the example at thebeginning of this section is an example of this. - The annotation can be on the same line as the function header or onthe following line.
- Variables use a comment-based type syntax (explained inExplicit types for variables).
- You don’t need to use string literal escapes for forward referenceswithin comments (string literal escapes are explained later).
- Mypy uses a separate set of library stub files in typeshed for Python 2. Library supportmay vary between Python 2 and Python 3.
当前内容版权归
Mypy 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问
Mypy .