时间:2021-07-01 10:21:17 帮助过:29人阅读
Python 3.5.0a3本回答至少在很多地方有错误 详情python 3.5 中 PEP0484 新加入的 Type Hints 的使用方法是什么? - 酿泉的回答Python 3.5.0a3 was released on March 30th, 2015.
Major new features of the 3.5 series, compared to 3.4Python 3.5 is still in development, and 3.5.0a1 is the second alpha release. Many new features are still being planned and written. Among the new major new features and changes in the 3.4 release series so far are
- PEP 461, adding support for "%-formatting" for bytes and bytearray objects
- PEP 465, a new operator (@) for matrix multiplication
- PEP 475, adding support for automatic retries of interrupted system calls
- PEP 471, os.scandir()
PEP 484, the typing module, a new standard for type annotations好爽,好爽,狂喜乱舞中!
from typing import TypeVar, Iterable, Tuple
T = TypeVar('T', int, float, complex)
Vector = Iterable[Tuple[T, T]]
def inproduct(v: Vector) -> T:
return sum(x*y for x, y in v)
Python 3.5将支持Async/Await异步编程