Python 3.8.0 正式发布,主要更新内容介绍

Python 3.8.0 正式发布了,以下是主要更新内容:

PEP 572, 赋值表达式

PEP 570, 仅位置参数

PEP 587, Python 初始化配置(改进嵌入)

PEP 590, Vectorcall:CPython 的快速调用协议

PEP 578, 运行时审核挂钩

PEP 574, 带外数据的 Pickle 协议 5

Typing 相关:PEP 591,PEP 586,PEP 589

并行文件系统缓存,用于编译的字节码

调试版本与发行版本共享 ABI

f 字符串支持一个方便的 = 说明符进行调试

continue 现在在 finally: 块中

在 Windows 上,默认的异步事件循环现在是 ProactorEventLoop

在 macOS 上,默认情况下现在在多进程中使用 spawn start 方法

现在,多进程(multiprocessing)可以使用共享内存段

typed_ast 合并回 CPython

LOAD_GLOBAL 现在快了 40%

pickle 现在默认使用协议 4,提高了性能 

Major new features of the 3.8 series, compared to 3.7

PEP 572, Assignment expressions

PEP 570, Positional-only arguments

PEP 587, Python Initialization Configuration (improved embedding)

PEP 590, Vectorcall: a fast calling protocol for CPython

PEP 578, Runtime audit hooks

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

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

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值