开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 1

scriptiot/micropython

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (6)
标签 (53)
master
esp32-idf41-cmake
docs-dev
parse-bytecode
cross
reentrant-gc
v1.19.1
v1.19
v1.18
v1.17
v1.16
v1.15
v1.14
v1.13
v1.12
v1.11
v1.10
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9
v1.8.7
v1.8.6
v1.8.5
v1.8.4
master
分支 (6)
标签 (53)
master
esp32-idf41-cmake
docs-dev
parse-bytecode
cross
reentrant-gc
v1.19.1
v1.19
v1.18
v1.17
v1.16
v1.15
v1.14
v1.13
v1.12
v1.11
v1.10
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9
v1.8.7
v1.8.6
v1.8.5
v1.8.4
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (6)
标签 (53)
master
esp32-idf41-cmake
docs-dev
parse-bytecode
cross
reentrant-gc
v1.19.1
v1.19
v1.18
v1.17
v1.16
v1.15
v1.14
v1.13
v1.12
v1.11
v1.10
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9
v1.8.7
v1.8.6
v1.8.5
v1.8.4
micropython
/
docs
/
differences
/
python_310.rst
micropython
/
docs
/
differences
/
python_310.rst
python_310.rst 27.07 KB
一键复制 编辑 原始数据 按行查看 历史
David Lechner 提交于 2022年11月28日 06:23 +08:00 . docs/differences: Add Python 3.10 page.

Python 3.10

Python 3.10.0 (final) was released on the 4 October 2021. The Features for 3.10 are defined in What's New in Python 3.10.

New syntax features Status
[1]
[1]
[1]
The :class:`int` type has a new method :meth:`int.bit_count`, returning the number of ones in the binary expansion of a given integer, also known as the population count.
The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict.items` now all have a mapping attribute that gives a :class:`types.MappingProxyType` object wrapping the original dictionary.
:func:`zip` function now has an optional strict flag, used to require that all the iterables have an equal length.
Builtin and extension functions that take integer arguments no longer accept :class:`~decimal.Decimal`s, :class:`~fractions.Fraction`s and other objects that can be converted to integers only with a loss (e.g. that have the :meth:`~object.__int__` method but do not have the :meth:`~object.__index__` method).
If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator will correctly fall back to :func:`object.__pow__` and :func:`object.__rpow__` as expected.
Assignment expressions can now be used unparenthesized within set literals and set comprehensions, as well as in sequence indexes (but not slices).
Functions have a new __builtins__ attribute which is used to look for builtin symbols when a function is executed, instead of looking into __globals__['__builtins__']. The attribute is initialized from __globals__["__builtins__"] if it exists, else from the current builtins.
Two new builtin functions -- :func:`aiter` and :func:`anext` have been added to provide asynchronous counterparts to :func:`iter` and :func:`next`, respectively.
Static methods (:func:`@staticmethod <staticmethod>`) and class methods (:func:`@classmethod <classmethod>`) now inherit the method attributes (__module__, __name__, __qualname__, __doc__, __annotations__) and have a new __wrapped__ attribute. Moreover, static methods are now callable as regular functions.
Annotations consist of yield, yield from, await or named expressions are now forbidden under from __future__ import annotations due to their side effects.
Usage of unbound variables, super() and other expressions that might alter the processing of symbol table as annotations are now rendered effectless under from __future__ import annotations.
Hashes of NaN values of both :class:`float` type and :class:`decimal.Decimal` type now depend on object identity. Formerly, they always hashed to 0 even though NaN values are not equal to one another. This caused potentially quadratic runtime behavior due to excessive hash collisions when creating dictionaries and sets containing multiple NaNs.
A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when deleting the :const:`__debug__` constant.
:exc:`SyntaxError` exceptions now have end_lineno and end_offset attributes. They will be None if not determined.

Changes to built-in modules:

The :meth:`~array.array.index` method of :class:`array.array` now has optional start and stop parameters.
The hashlib module has preliminary support for OpenSSL 3.0.0.
The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In the future PBKDF2-HMAC will only be available when Python has been built with OpenSSL support.
Add :func:`os.cpu_count()` support for VxWorks RTOS.
Add a new function :func:`os.eventfd` and related helpers to wrap the eventfd2 syscall on Linux.
Add :func:`os.splice()` that allows to move data between two file descriptors without copying between kernel address space and user address space, where one of the file descriptors must refer to a pipe.
Add :func:`platform.freedesktop_os_release()` to retrieve operation system identification from The exception :exc:`socket.timeout` is now an alias of :exc:`TimeoutError`.
Add option to create MPTCP sockets with IPPROTO_MPTCP.
Add IP_RECVTOS option to receive the type of service (ToS) or DSCP/ECN fields.
Deprecated function and use of deprecated constants now result in a :exc:`DeprecationWarning`. :attr:`ssl.SSLContext.options` has :data:`~ssl.OP_NO_SSLv2` and :data:`~ssl.OP_NO_SSLv3` set by default and therefore cannot warn about setting the flag again.
The ssl module now has more secure default settings. Ciphers without forward secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits weak RSA, DH, and ECC keys with less than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2. Settings are based on Hynek Schlawack's research.
The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer officially supported. Python does not block them actively. However OpenSSL build options, distro configurations, vendor patches, and cipher suites may prevent a successful handshake.
Add a timeout parameter to the :func:`ssl.get_server_certificate` function.
The ssl module uses heap-types and multi-phase initialization.
A new verify flag :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added.
Add :data:`sys.orig_argv` attribute: the list of the original command line arguments passed to the Python executable.
Add :data:`sys.stdlib_module_names`, containing the list of the standard library module names.
:func:`_thread.interrupt_main` now takes an optional signal number to simulate (the default is still :data:`signal.SIGINT`).

Notes

[1] (1, 2, 3) The structural pattern matching feature is discussed in /scriptiot/micropython/blob/master/docs/differences/python_310.rst
MIT
使用 MIT 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/scriptiot/micropython.git
git@gitee.com:scriptiot/micropython.git
scriptiot
micropython
micropython
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /