2021年10月7日

Python 3函数的参数冒号注释

摘要: Python 3.7版本,函数的参数可以通过冒号来进行注释 def f(ham: str, eggs: str = 'eggs') -> str : print("Annotations:", f.__annotations__) print("Arguments:", ham, eggs) ret 阅读全文

posted @ 2021-10-07 15:55 lmqljt 阅读(428) 评论(0) 推荐(0) 编辑

导航