[issue32338] Save OrderedDict import in re

2018-03-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: -Dict order is now guaranteed, so add tests and doc for it resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32338] Save OrderedDict import in re

2018-03-10 Thread miss-islington
miss-islington added the comment: New changeset 39441fce0218a3f51a80cf17aa179a32651a02f6 by Miss Islington (bot) in branch '3.7': bpo-32338: OrderedDict import is no longer needed in re. (GH-4891) https://github.com/python/cpython/commit/39441fce0218a3f51a80cf17aa179a32651a02f6 -- no

[issue32338] Save OrderedDict import in re

2018-03-10 Thread miss-islington
Change by miss-islington : -- pull_requests: +5833 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue32338] Save OrderedDict import in re

2018-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b931bd0a2fe7e9293339019352baf3317166b769 by Serhiy Storchaka in branch 'master': bpo-32338: OrderedDict import is no longer needed in re. (#4891) https://github.com/python/cpython/commit/b931bd0a2fe7e9293339019352baf3317166b769 -- __

[issue32338] Save OrderedDict import in re

2017-12-25 Thread Srinivas Reddy T
Change by Srinivas Reddy T : -- pull_requests: +4903 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue32338] Save OrderedDict import in re

2017-12-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Dict order is now guaranteed, so add tests and doc for it ___ Python tracker ___ ___ P

[issue32338] Save OrderedDict import in re

2017-12-18 Thread INADA Naoki
INADA Naoki added the comment: * del cache[next(iter(cache))] happens only when sre.compile() is called. * del cache[next(iter(cache))] is much faster than sre.compile(). OK, performance difference is negligible, surely. -- ___ Python tracker

[issue32338] Save OrderedDict import in re

2017-12-18 Thread INADA Naoki
INADA Naoki added the comment: > We are talking about a dictionary of 512 items in the worst case. On such > very tiny collection, benchmarking matters more than O(...) complexity ;-) You're right. Rob Pike said: "Fancy algorithms are slow when n is small, and n is usually small." http://user

[issue32338] Save OrderedDict import in re

2017-12-18 Thread STINNER Victor
STINNER Victor added the comment: > del d[next(iter(d))] is not O(1) on current dict implementation. We are talking about a dictionary of 512 items in the worst case. On such very tiny collection, benchmarking matters more than O(...) complexity ;-) -- nosy: +vstinner ___

[issue32338] Save OrderedDict import in re

2017-12-18 Thread INADA Naoki
INADA Naoki added the comment: Hmm, 0.3 μs for each lookup may be negligible compared to re.compile() speed? -- ___ Python tracker ___ _

[issue32338] Save OrderedDict import in re

2017-12-18 Thread INADA Naoki
INADA Naoki added the comment: > This is surprising. But OrderedDict also can be O(N) here. Current dict implementation doesn't skip empty entries. So next(iter(D)) takes time. On the other hand, OrderedDict uses doubly-linked list to find first entry. (I fixed it in compact ODict branch, but

[issue32338] Save OrderedDict import in re

2017-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is surprising. But OrderedDict also can be O(N) here. Do you have benchmarking results Inada? -- ___ Python tracker ___ __

[issue32338] Save OrderedDict import in re

2017-12-17 Thread INADA Naoki
INADA Naoki added the comment: Please don't do this. del d[next(iter(d))] is not O(1) on current dict implementation. OrderedDict is designed for such use cases. Please keep using it. -- nosy: +inada.naoki ___ Python tracker

[issue32338] Save OrderedDict import in re

2017-12-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4784 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue32338] Save OrderedDict import in re

2017-12-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Since regular dicts are now ordered by default, the OrderedDict import is no longer necessary. -- components: Library (Lib), Regular Expressions messages: 308418 nosy: ezio.melotti, mrabarnett, rhettinger, serhiy.storchaka priority: normal severity