Steven D'Aprano added the comment:
Duplicate of this: http://bugs.python.org/issue6017
--
nosy: +stevenjd
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
___
Changes by Steven D'Aprano steve+pyt...@pearwood.info:
--
nosy: -stevenjd
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
___
___
Raymond Hettinger added the comment:
A few thoughts:
* No existing, working code will benefit from this patch; however, almost all
code will pay a price for it -- bigger size for an empty dict and a runtime
cost (possibly very small) on the critical path (every time a value is stored
in a
Ethan Furman added the comment:
Raymond, please don't be so concise.
Is the code unimportant because the scenario is so rare, or something else?
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
___
Raymond Hettinger added the comment:
I disagree with adding such unimportant code to the critical path.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
___
Serhiy Storchaka added the comment:
In the first patch the counter was placed in the _dictkeysobject structure. In
the second place it is placed in the PyDictObject so it now has no memory cost.
Access time to new counter for non-modifying operations is same as in current
code. The only
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +tim.peters
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
___
___
Python-bugs-list
Antoine Pitrou added the comment:
If there's no performance regression, then this sounds like a reasonable idea.
The remaining question would be whether it can break existing code. Perhaps you
should ask python-dev?
--
___
Python tracker
Raymond Hettinger added the comment:
The decision to not monitor adding or removing keys was intentional. It is
just not worth the cost in either time or space.
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
New submission from Serhiy Storchaka:
Currently dict iterating is guarded against changing dict's size. However when
dict changed during iteration so that it's size left unchanged, this
modification left unnoticed.
d = dict.fromkeys('abcd')
for i in d:
... print(i)
... d[i + 'x'] =
11 matches
Mail list logo