7.3小节完成
This commit is contained in:
14
cookbook/c07/p03_func_annotate.py
Normal file
14
cookbook/c07/p03_func_annotate.py
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- encoding: utf-8 -*-
|
||||
"""
|
||||
Topic: 函数注解元信息
|
||||
Desc :
|
||||
"""
|
||||
|
||||
def add(x:int, y:int) -> int:
|
||||
return x + y
|
||||
|
||||
help(add)
|
||||
|
||||
print(add.__annotations__)
|
||||
|
||||
Reference in New Issue
Block a user