当前位置:Gxlcms > Python > Python3.5有什么新特性?

Python3.5有什么新特性?

时间:2021-07-01 10:21:17 帮助过:29人阅读

回复内容:

官网就有,何必问?
Python Release Python 3.5.0a3
Python 3.5.0a3

Python 3.5.0a3 was released on March 30th, 2015.


Major new features of the 3.5 series, compared to 3.4

Python 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()
本回答至少在很多地方有错误 详情python 3.5 中 PEP0484 新加入的 Type Hints 的使用方法是什么? - 酿泉的回答

怒答,今天看到,昨天发布的,Python 3.5b1 有类型检查模块了!
以前有 mypy,现在终于是官方的了!def fuck(x: Fuck) -> Fuck 这种语法以前唯一的意义在能让 PyCharm 补全

Python Release Python 3.5.0b1
PEP 484, the typing module, a new standard for type annotations
好爽,好爽,狂喜乱舞中!

这一刻,TypeScript Flow TypedRacket 灵魂附体!现在 Python 某种程度上能同时享受静态类型语言的安全和动态类型语言的灵活性了,某种程度。

正在看 PEP 0484 -- Type Hints

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异步编程

人气教程排行