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
Title: Allow developer to resize the dictionary
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: methane, penguin_wwy, rhettinger
Priority: normal Keywords: patch

Created on 2022-02-21 07:32 by penguin_wwy, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31461 closed penguin_wwy, 2022-02-21 07:37
Messages (5)
msg413634 - (view) Author: penguin_wwy (penguin_wwy) * Date: 2022-02-21 07:32
https://github.com/faster-cpython/ideas/discussions/288
msg413635 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-02-21 07:41
This idea surfaced once before and Guido shot it down.  IIRC the rationale was the exposed implementation details, that would challenging for users to consistently set the size correctly, and that it may not make sense for other implementations.

This was a good while ago so it may be worth scanning the tracker or python-dev archives to find where he opined.
msg413638 - (view) Author: penguin_wwy (penguin_wwy) * Date: 2022-02-21 08:09
I tried to look for it in issue list two days ago but couldn't find it. Maybe I should have been more careful :(.

However, I think it is a useful modification. Just need to return a dict that satisfies the user's requirements, and the developers themselves should be responsible for their code (if they can't use it exactly, they should choose to use the default, and python needs to do is provide that optional ability)
msg413640 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2022-02-21 08:28
As I commented in https://github.com/faster-cpython/ideas/discussions/288, your benchmark is not fair.

Include `{}` and `{}.resize(len(cases))` into the measured function.
msg413811 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-02-23 15:31
I'm going to close this one.  Making a new and previously rejected extension to one of Python's most import APIs requires broad discussion and buy-in.  If you really want to push for this, please take it to the python-ideas list.
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 90969
2022-02-23 15:31:36rhettingersetstatus: open -> closed
resolution: rejected
messages: + msg413811

stage: patch review -> resolved
2022-02-21 08:28:52methanesetnosy: + methane
messages: + msg413640
2022-02-21 08:09:37penguin_wwysetmessages: + msg413638
2022-02-21 07:41:47rhettingersetnosy: + rhettinger
messages: + msg413635
2022-02-21 07:37:35penguin_wwysetkeywords: + patch
stage: patch review
pull_requests: + pull_request29590
2022-02-21 07:32:59penguin_wwycreate