澳门新葡亰信誉平台游戏Python 3.4.0 正式版发布

by admin on 2020年1月14日

Python 3.3 发布了,该版本包含大量的改进,同时也可方便的从 2.x 移植到
3.x,3.3 主要的改进记录包括:

Python 发布了 3.3.0 首个 beta 版本,该版本包含了
3.x 系列的很多改进内容,主要包括:

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

  • PEP 380, syntax for
    delegating to a subgenerator (yield from)
  • PEP 393, flexible string
    representation (doing away with the distinction between “wide” and
    “narrow” Unicode builds)
  • A C implementation of the “decimal” module, with up to 80x speedup
    for decimal-heavy applications
  • The import system (__import__) is based on importlib by default
  • The new “lzma” module with LZMA/XZ support
  • PEP 405, virtual
    environment support in core
  • PEP 420, namespace
    package support
  • PEP 3151, reworking the
    OS and IO exception hierarchy
  • 澳门新葡亰信誉平台游戏 ,PEP 3155, qualified name
    for classes and functions
  • PEP 409, suppressing
    exception context
  • PEP 414, explicit Unicode
    literals to help with porting
  • PEP 418, extended
    platform-independent clocks in the “time” module
  • PEP 412, a new
    key-sharing dictionary implementation that significantly saves
    memory for object-oriented code
  • The new “faulthandler” module that helps diagnosing crashes
  • The new “unittest.mock” module
  • The new “ipaddress” module
  • A “collections.ChainMap” class for linking mappings to a single unit
  • Wrappers for many more POSIX functions in the “os” and “signal”
    modules, as well as other useful functions such as “sendfile()”
  • Hash randomization, introduced in earlier bugfix releases, is now
    switched on by default

* PEP 380, syntax for delegating to a subgenerator (“yield from”)
* PEP 393, flexible string representation (doing away with the
distinction between “wide” and “narrow” Unicode builds)
* A C implementation of the “decimal” module, with up to 80x speedup
for decimal-heavy applications
* The import system (__import__) now based on importlib by
default
* The new “lzma” module with LZMA/XZ support
* PEP 397, a Python launcher for Windows
* PEP 405, virtual environment support in core
* PEP 420, namespace package support
* PEP 3151, reworking the OS and IO exception hierarchy
* PEP 3155, qualified name for classes and functions
* PEP 409, suppressing exception context
* PEP 414, explicit Unicode literals to help with porting
* PEP 418, extended platform-independent clocks in the “time” module
* PEP 412, a new key-sharing dictionary implementation that
   significantly saves memory for object-oriented code
* PEP 362, the function-signature object
* The new “faulthandler” module that helps diagnosing crashes
* The new “unittest.mock” module
* The new “ipaddress” module
* The “sys.implementation” attribute
* A policy framework for the email package, with a provisional (see PEP
411) policy that adds much improved unicode support for email header
parsing
* A “collections.ChainMap” class for linking mappings to a single
unit
* Wrappers for many more POSIX functions in the “os” and “signal”
modules, as well as other useful functions such as “sendfile()”
* Hash randomization, introduced in earlier bugfix releases, is now
switched on by default

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

详细改进内容:
    

新语法特性:

下载地址:
    

  • Python 3.4 并未添加任何新的语法特性

(文/开源中国)    

其他新特性:

  • 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).

新的库模块:

  • 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).

库模块中重大的改进:

  • Single-dispatch generic
    functions

    infunctools
    (PEP 443).

  • New
    pickle
    protocol
    4

    (PEP 3154).

  • multiprocessing
    now has an option to avoid using os.fork on
    Unix

    (issue 8713).

  • email
    has a new submodule,
    contentmanager,
    and a new
    Message
    subclass (EmailMessage) that simplify MIME
    handling

    (issue 18891).

  • The
    inspect
    and
    pydoc
    modules are now capable of correct introspection of a much wider
    variety of callable objects, which improves the output of the Python
    help()
    system.

  • The
    ipaddress
    module API has been declared stable

安全改进:

  • Secure and interchangeable hash
    algorithm
    (PEP
    456
    ).

  • Make newly created file descriptors
    non-inheritable
    (PEP
    446
    ) to avoid leaking
    file descriptors to child processes.

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

  • multiprocessing
    now has an option to avoid using os.fork on
    Unix
    .
     spawn and forkserver are more secure because they avoid sharing
    data with child processes.

  • multiprocessing
    child processes on Windows no longer inherit all of the parent’s
    inheritable handles, only the necessary ones.

  • A new
    hashlib.pbkdf2_hmac()
    function provides the PKCS#5 password-based key derivation
    function 2.

  • TLSv1.1 and TLSv1.2
    support

    for ssl.

  • Retrieving certificates from the Windows system cert store
    support

    for ssl.

  • Server-side SNI (Server Name Indication)
    support

    for ssl.

  • The
    ssl.SSLContext
    class has a lot of
    improvements
    .

  • All modules in the standard library that support SSL now support
    server certificate verification, including hostname matching
    (ssl.match_hostname())
    and CRLs (Certificate Revocation lists,
    seessl.SSLContext.load_verify_locations()).

CPython 实现改进:

  • Safe object
    finalization

    (PEP 442).

  • Leveraging PEP 442,
    in most cases module globals are no longer set to None during
    finalization

    (issue 18214).

  • Configurable memory
    allocators

    (PEP 445).

  • Argument
    Clinic

    (PEP 436).

其他的还包括许多 CPython
的优化,用法和潜在移植问题,更多内容请看发行说明,新特性介绍或者是更新日志,可以在这里下载最新版本。

(文/开源中国)    

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图