[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 46e329ef13ae by INADA Naoki in branch '2.7': Issue #29019: Fix dict.fromkeys(x) overallocates when x is sparce dict. https://hg.python.org/cpython/rev/46e329ef13ae -- nosy: +python-dev ___ Python tracker

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread INADA Naoki
INADA Naoki added the comment: While the patch is trivial, I need LGTM from another comitter. -- stage: -> patch review Added file: http://bugs.python.org/file45974/fromkeys2.patch ___ Python tracker

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread INADA Naoki
INADA Naoki added the comment: Since `seq` is checked by PyDict_CheckExact(seq) already, ((PyDictObject*)seq)->ma_used may be better. -- ___ Python tracker

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread Rasmus Villemoes
New submission from Rasmus Villemoes: Somewhat related to #23971, but with the opposite sign: Using Py_SIZE on a PyDictObject gives the ma_fill member in 2.7 (and until 3.2 AFAICT), not the ma_used member. So calling dict.fromkeys(d) overallocates significantly if a lot of elements have been