[issue38613] Optimize some set operations in dictkeys object

2019-11-07 Thread Inada Naoki
Inada Naoki added the comment: New changeset 6cbc84fb99acb33dd659d7adb29a20adbe62b74a by Inada Naoki in branch 'master': bpo-38613: Optimize set operations of dict keys. (GH-16961) https://github.com/python/cpython/commit/6cbc84fb99acb33dd659d7adb29a20adbe62b74a --

[issue38613] Optimize some set operations in dictkeys object

2019-11-07 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue38613] Optimize some set operations in dictkeys object

2019-10-30 Thread Inada Naoki
Inada Naoki added the comment: done. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38613] Optimize some set operations in dictkeys object

2019-10-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Consider testing PyDict_CheckExact. -- nosy: +rhettinger ___ Python tracker ___ ___

[issue38613] Optimize some set operations in dictkeys object

2019-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But what if a dict subclass overrides __iter__? You can get different result if set(d) != set(d.keys()). -- ___ Python tracker ___

[issue38613] Optimize some set operations in dictkeys object

2019-10-29 Thread Inada Naoki
Inada Naoki added the comment: > How does it work with dict subclasses? PySet_New(iterable) uses fast path only when `PyDict_CheckExact(iterable)` is true. So there is no change for dict subclasses. -- ___ Python tracker

[issue38613] Optimize some set operations in dictkeys object

2019-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How does it work with dict subclasses? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue38613] Optimize some set operations in dictkeys object

2019-10-28 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +16489 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16961 ___ Python tracker ___

[issue38613] Optimize some set operations in dictkeys object

2019-10-28 Thread Inada Naoki
New submission from Inada Naoki : -, |, and ^ of dictkeys are implemented as: PyObject *result = PySet_New(self); // Call set.difference_update, set.update, set.symmetric_difference_update with other. PySet_New(iterable) has optimized step for iterable is dict. But since iterable is