[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset cc47d385512b by Raymond Hettinger in branch 'default': Complete the merge for issue #29203 https://hg.python.org/cpython/rev/cc47d385512b -- ___ Python tracker ___

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 48c750c26710 by Raymond Hettinger in branch '3.6': Issue #29203: functools.lru_cache() now respects PEP 468 https://hg.python.org/cpython/rev/48c750c26710 -- nosy: +python-dev ___ Python tracker

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that fixes also C implementation and has tests. -- type: performance -> behavior versions: +Python 3.6 Added file: http://bugs.python.org/file46213/lru_cache_pep468.patch ___ Python tracker

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I think this is a bug and it should be fixed in 3.6. I concur. Do you care to whip-up a patch (it is late here). -- ___ Python tracker __

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is a bug and it should be fixed in 3.6. Currenly lru_cache breaks PEP 468 (Preserving Keyword Argument Order). >>> from functools import lru_cache >>> @lru_cache() ... def f(**kwargs): ... return list(kwargs.items()) ... >>> f(a=1, b=2) [('a

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Raymond Hettinger
New submission from Raymond Hettinger: Since the ordering of keyword arguments is now guaranteed, the LRU cache doesn't need to sort any longer. The will give a small change in behavior that I don't care about. A call f(a=1, b=2) would now be cached separately from f(b=2, a=1). That won't ar