Python 3.5 正式发布,此版本主要改进如下:

Python 3.4.0 发布,此版本包括一系列 3.x 系列的改进,数百个小的改进和 bug
修复。

新语法特性

值得注意的更新内容如下:

  • PEP
    492
    ,
    异步协同和 await 语法

  • PEP
    465
    ,
    新矩阵乘法运算符: a @ b.

  • PEP
    448
    ,
    additional unpacking generalizations.

新语法特性:

新库模块

  • Python 3.4 并未添加任何新的语法特性
  • typing:
    PEP 484 – Type
    Hints
    .

  • zipapp:
    PEP 441 改进 Python ZIP
    应用支持.

其他新特性:

新内置特性

  • pip should always be
    available

    (PEP 453).

  • Newly created file descriptors are
    non-inheritable
    (PEP
    446
    ).

  • command line option for isolated
    mode
    (issue
    16499).

  • improvements in the handling of
    codecs
    that
    are not text encodings (multiple issues).

  • A ModuleSpec
    Type

    for the Import System (PEP
    451
    ).  (Affects importer
    authors.)

  • The
    marshal
    format has been made more compact and
    efficient

    (issue 16475).

  • bytes % args, bytearray % args: PEP
    461

    – 添加 % 格式化字节和字节数组

  • b'xf0x9fx90x8d'.hex(),
    bytearray(b'xf0x9fx90x8d').hex(),memoryview(b'xf0x9fx90x8d').hex():
    issue 9951 – 添加 hex 模块

  • memoryview
    支持 tuple indexing (including multi-dimensional). (Contributed by
    Antoine Pitrou in issue
    23632.)

  • Generators 添加了新 gi_yieldfrom澳门新葡亰, 属性(Contributed by Benno Leslie
    and Yury Selivanov in issue
    24450.)


  • RecursionError
    异常 (Contributed by Georg Brandl in issue
    19235.)

新的库模块:

CPython 实现改进

  • asyncio:
    New provisional API for asynchronous
    IO

    (PEP 3156).

  • ensurepip:
    Bootstrapping the pip
    installer
    (PEP
    453
    ).

  • enum:
    Support for enumeration
    types
    (PEP
    435
    ).

  • pathlib:
    Object-oriented filesystem
    paths
    (PEP
    428
    ).

  • selectors:
    High-level and efficient I/O
    multiplexing
    ,
    built upon the
    select
    module primitives (part of PEP
    3156
    ).

  • statistics:
    A basic numerically stable statistics
    library

    (PEP 450).

  • tracemalloc:
    Trace Python memory
    allocations

    (PEP 454).

  • LC_TYPE locale 是 POSIX locale (C
    locale)时,sys.stdin

    sys.stdout
    现在使用 surrogateescape 错误处理器,替换之前的 strict
    错误处理器 (Contributed by Victor Stinner in issue
    19977.)

  • .pyo 不再使用,用另外一个灵活的模式替换 (See PEP 488
    overview
    .)

  • 内置和扩展模块加载改进 (See PEP 489
    overview
    .)

库模块中重大的改进:

网站地图xml地图