Mark Shannon <m...@hotpy.org> added the comment:
In general, I agree with Raymond that this is likely to counter-productive. But let's not guess, let's measure :) I expect that there are few live empty dicts at any time for most programs. In which case there is no point in any change that attempts to save memory use for empty dicts. But I could be wrong. If there commonly are lots of live empty dicts, then some sort of optimisation could be appropriate. I should also add that dict.clear() uses a key-sharing dict to avoid allocation, because PyDict_Clear() is a void function so there is no way to handle an allocation failure. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue30040> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com