Python 3.8首个预览版发布,新功能抢先看

640?wx_fmt=jpeg


整理|suiling


Python官网信息显示,目前Python 3.8仍处于开发阶段,该版本将会发布4个预览版,此次发布的是首个预览版。为了更快地进行优化和bug修复,Python官网建议第三方Python项目维护者使用Python 3.8进行测试。不过由于目前尚处于开发阶段,到正式版发布之前仍会对功能进行调整,所以官方不建议开发者在生产环境中使用测试版,以免给工作造成不便。


与Python 3.7版本相比,3.8系列的主要新功能和更改包括:


  • PEP 572, Assignment expressions

    https://www.python.org/dev/peps/pep-0572/

  • PEP 570, Positional-only arguments

    https://www.python.org/dev/peps/pep-0570/

  • PEP 587, Python Initialization Configuration (improved embedding)

    https://www.python.org/dev/peps/pep-0587/

  • PEP 590, Vectorcall: a fast calling protocol for CPython

    https://www.python.org/dev/peps/pep-0587/

  • PEP 578, Runtime audit hooks

    https://www.python.org/dev/peps/pep-0587/

  • PEP 574, Pickle protocol 5 with out-of-band data

    https://www.python.org/dev/peps/pep-0574/

  • Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal types), and PEP 589 (TypedDict)

  • Parallel filesystem cache for compiled bytecode

  • Debug builds share ABI as release builds

  • f-strings support a handy = specifier for debugging

  • continue is now legal in finally: blocks

  • on Windows, the default asyncio event loop is now ProactorEventLoop

  • on macOS, the spawn start method is now used by default in multiprocessing

  • multiprocessing can now use shared memory segments to avoid pickling costs between processes

  • typed_ast is merged back to CPython

  • LOAD_GLOBAL is now 40% faster

  • pickle now uses Protocol 4 by default, improving performance

  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Łukasz know.)


此外,新版本中还有其他一些有趣的改变,详情请查看文档的"What's New" 页面。


同时,Python官网还预告,将会在7月1日发布第二个测试版本。


更多信息,请在官网查看:

https://www.python.org/downloads/release/python-380b1/


(*本文由Python大本营整理,转载请联系微信1092722531)


精彩推荐


640?wx_fmt=jpeg

推荐阅读

640?wx_fmt=png 你点的每个“在看”,我都认真当成了喜欢



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值