Files
python3-cookbook/cookbook/c07/p03_func_annotate.py

15 lines
181 B
Python
Raw Permalink Normal View History

2015-01-08 11:20:26 +08:00
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 函数注解元信息
Desc :
"""
def add(x:int, y:int) -> int:
return x + y
help(add)
print(add.__annotations__)