[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread Dong-hee Na
Dong-hee Na added the comment: Thanks for reporting Kevin! -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
miss-islington added the comment: New changeset 2d4049da1f61df5cb4314d7e10b54fa556880b0e by Miss Islington (bot) in branch '3.9': bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290) https://github.com/python/cpython/commit/2d4049da1f61df5cb4314d7e10b54fa556880b0e --

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
miss-islington added the comment: New changeset 1b37268ef10bd20c30d349b8401c88215c8a6be8 by Miss Islington (bot) in branch '3.10': bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290) https://github.com/python/cpython/commit/1b37268ef10bd20c30d349b8401c88215c8a6be8 --

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset fb44d0589615590b1e7895ba78a038e96b15a219 by Dong-hee Na in branch 'main': bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290) https://github.com/python/cpython/commit/fb44d0589615590b1e7895ba78a038e96b15a219 --

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +28512 pull_request: https://github.com/python/cpython/pull/30300 ___ Python tracker ___

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28511 pull_request: https://github.com/python/cpython/pull/30299 ___ Python tracker

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch nosy: +corona10 nosy_count: 4.0 -> 5.0 pull_requests: +28504 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30290 ___ Python tracker

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-16 Thread Kevin Shweh
Kevin Shweh added the comment: Almost - C's weird bitwise operator precedence means it has to be parenthesized as if ((kind & _odict_ITER_ITEMS) == _odict_ITER_ITEMS) -- ___ Python tracker

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Inada Naoki
Inada Naoki added the comment: Nice catch. > if ((kind & _odict_ITER_KEYS) && (kind &_odict_ITER_VALUES)) You can reduce one branch by ``` #define _odict_ITER_ITEMS (_odict_ITER_KEYS|_odict_ITER_VALUES) ... if (kind & _odict_ITER_ITEMS == _odict_ITER_ITEMS) ``` -- nosy:

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +rhettinger versions: -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Kevin Shweh
New submission from Kevin Shweh : The OrderedDict iterator caches a di_result tuple for use with iter(od.items()). It's *supposed* to only do that for the items() case, but the code does if (kind & (_odict_ITER_KEYS | _odict_ITER_VALUES)) to test for this case. This is the wrong test.