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.

Author methane
Recipients Mark.Shannon, methane, rhettinger, terry.reedy
Date 2022-02-25.22:44:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAEfz+TwN+uzcMMN+SbAyF00PsEYU95V-zi2VBWSH-g3cy_mZ6A@mail.gmail.com>
In-reply-to <1645823366.53.0.282544941794.issue46845@roundup.psfhosted.org>
Content
>
>
> Do you propose to
> 1. Only use StringKeyDicts when non-string keys are not possible?  (Where
> would this be?)
> 2. Switch to a normal dict when a non-string key is added?  (But likely
> not switch back when the last non-string key is removed.)
> 3. Deprecate and remove the option to add non-string keys to namespace
> dicts?  (Proposed and rejected at least once as not gaining much.)
>
>
>

2. We already do such hack for key sharing dict.
And yes, deleting non string key doesn't switch back. d[0]=0; del d[0];
loop must be amortized O(1).
Only dict.clear() switches back.
History
Date User Action Args
2022-02-25 22:44:39methanesetrecipients: + methane, rhettinger, terry.reedy, Mark.Shannon
2022-02-25 22:44:39methanelinkissue46845 messages
2022-02-25 22:44:39methanecreate