Message414045
>
>
> 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. |
|
Date |
User |
Action |
Args |
2022-02-25 22:44:39 | methane | set | recipients:
+ methane, rhettinger, terry.reedy, Mark.Shannon |
2022-02-25 22:44:39 | methane | link | issue46845 messages |
2022-02-25 22:44:39 | methane | create | |
|