➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: Using collections ABC from collections.abc rather than collections in 2to3 converted code
类型: enhancement Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.7
process
状态: closed Resolution: fixed
Dependencies: 后续:
分配给: 抄送列表: benjamin.peterson, rhettinger, serhiy.storchaka
优先级: normal 关键字:

Created on 2017-04-23 12:11 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1262 merged serhiy.storchaka, 2017-04-23 12:13
Messages (4)
msg292163 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2017-04-23 12:11
Proposed patch makes 2to3 generating a code that uses abstract collection classes Sequence and Mapping from collections.abc rather than collections. Since abstract collection classes now are defined in collections.abc and collections contains only aliases for compatibility, this is more idiomatic Python 3 code.
msg306279 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2017-11-15 16:03
What are your thoughts about this Benjamin?
msg306282 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) 日期: 2017-11-15 16:33
+1 I think this change will be essential.  IIRC, elsewhere Guido approved a 3.7 change so that the ABC will no longer be visible in collections.
msg306341 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2017-11-16 07:16
New changeset 0a2abdfca2495291809855cf7dfc6721c9c962e3 by Serhiy Storchaka in branch 'master':
bpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262)
https://github.com/python/cpython/commit/0a2abdfca2495291809855cf7dfc6721c9c962e3
历史
日期 用户 动作 参数
2022-04-11 14:58:45admin修改github: 74329
2017-11-16 07:19:42serhiy.storchaka修改状态: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-11-16 07:16:27serhiy.storchaka修改消息: + msg306341
2017-11-15 16:33:29rhettinger修改抄送: + rhettinger
消息: + msg306282
2017-11-15 16:03:56serhiy.storchaka修改消息: + msg306279
2017-04-23 12:13:57serhiy.storchaka修改pull_requests: + pull_request1375
2017-04-23 12:11:25serhiy.storchaka创建