Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue32473

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Readibility of ABCMeta._dump_registry()
Type:enhancementStage:resolved
Components:Versions:Python 3.7, Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: levkivskyi, methane, yahya-abou-imran
Priority:normalKeywords:patch

Created on2018-01-01 06:09 byyahya-abou-imran, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 5091mergedyahya-abou-imran,2018-01-03 18:20
PR 5163mergedpython-dev,2018-01-12 09:22
Messages (3)
msg309321 -(view)Author: Yahya Abou Imran (yahya-abou-imran)*Date: 2018-01-01 06:09
From python-ideas:https://mail.python.org/pipermail/python-ideas/2017-December/048504.htmlIn python 2.7, ABCs's caches and registries are sets. But in python 3.6 they are WeakSet.In consequence, the output of _dump_registry() is almost useless:>>> from collections import abc>>> abc.Iterator._dump_registry()Class: collections.abc.IteratorInv.counter: 40_abc_cache: <_weakrefset.WeakSet object at 0x7f4b58fe2668>_abc_negative_cache: <_weakrefset.WeakSet object at 0x7f4b53283780>_abc_negative_cache_version: 40_abc_registry: <_weakrefset.WeakSet object at 0x7f4b58fe2630>We could convert them into a regular set before printing:if isinstance(value, WeakSet):    value = set(value)The result:>>> abc.Iterator._dump_registry()Class: collections.abc.IteratorInv.counter: 40_abc_cache: {<class 'dict_valueiterator'>, <class 'bytearray_iterator'>, <class 'tuple_iterator'>, <class 'dict_itemiterator'>, <class 'dict_keyiterator'>, <class 'str_iterator'>, <class 'zip'>, <class 'set_iterator'>, <class 'list_reverseiterator'>, <class 'range_iterator'>, <class 'longrange_iterator'>, <class 'list_iterator'>, <class 'bytes_iterator'>}_abc_negative_cache: set()_abc_negative_cache_version: 40_abc_registry: set()
msg309840 -(view)Author: Inada Naoki (methane)*(Python committer)Date: 2018-01-12 09:18
New changesetae12f5d4c98f2095c2aadd58981453e955044697 by INADA Naoki (yahya-abou-imran) in branch 'master':bpo-32473: Improve ABCMeta._dump_registry() readability (GH-5091)https://github.com/python/cpython/commit/ae12f5d4c98f2095c2aadd58981453e955044697
msg309847 -(view)Author: Inada Naoki (methane)*(Python committer)Date: 2018-01-12 10:47
New changeseta91662affeb0aae2515cdc5e8f82269337105bf4 by INADA Naoki (Miss Islington (bot)) in branch '3.6':bpo-32473: Improve ABCMeta._dump_registry() readability (GH-5091)https://github.com/python/cpython/commit/a91662affeb0aae2515cdc5e8f82269337105bf4
History
DateUserActionArgs
2022-04-11 14:58:56adminsetgithub: 76654
2018-01-12 10:48:15methanesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-01-12 10:47:42methanesetmessages: +msg309847
2018-01-12 09:22:22python-devsetpull_requests: +pull_request5019
2018-01-12 09:18:51methanesetnosy: +methane
messages: +msg309840
2018-01-05 16:56:14levkivskyisetnosy: +levkivskyi
2018-01-03 18:20:16yahya-abou-imransetkeywords: +patch
stage: patch review
pull_requests: +pull_request4963
2018-01-01 06:09:25yahya-abou-imrancreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp