【发布时间】:2017-02-06 03:45:24
【问题描述】:
我在 Ipython 中看到了这个源代码:
我知道这是 python3 中一个名为Function Annotation 的新功能。
但此代码也可以在 Python 2.7 中使用。为什么?
如何在 Python 2.7 中使用Function Annotation?
【问题讨论】:
-
即使在 PY3 中,注释的使用也是有限的。解释器不使用它们。 python.org/dev/peps/pep-0484
标签: python python-2.7 annotations ipython