diff options
author | Raymond Hettinger <python@rcn.com> | 2017-01-09 01:29:21 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2017-01-09 01:29:21 (GMT) |
commit | ac7c5acf9b1e474adfae5da6841e0d4cb343d7e8 (patch) | |
tree | abebf8a6965be6ad10beda6b0076f5a4d4c62b93 /Lib/test/test_functools.py | |
parent | ce16c6827c3ce1253cf63518ef1da30a88f50623 (diff) | |
parent | 4ee39141e84c511e389080fa3163be043718ea14 (diff) | |
download | cpython-ac7c5acf9b1e474adfae5da6841e0d4cb343d7e8.zip cpython-ac7c5acf9b1e474adfae5da6841e0d4cb343d7e8.tar.gz cpython-ac7c5acf9b1e474adfae5da6841e0d4cb343d7e8.tar.bz2 |
merge
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r-- | Lib/test/test_functools.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index ae0d9f7..9f4899e 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -1342,6 +1342,16 @@ class TestLRU: self.assertEqual(fib.cache_info(), self.module._CacheInfo(hits=0, misses=0, maxsize=None, currsize=0)) + def test_kwargs_order(self): + # PEP 468: Preserving Keyword Argument Order + @self.module.lru_cache(maxsize=10) + def f(**kwargs): + return list(kwargs.items()) + self.assertEqual(f(a=1, b=2), [('a', 1), ('b', 2)]) + self.assertEqual(f(b=2, a=1), [('b', 2), ('a', 1)]) + self.assertEqual(f.cache_info(), + self.module._CacheInfo(hits=0, misses=2, maxsize=10, currsize=2)) + def test_lru_cache_decoration(self): def f(zomg: 'zomg_annotation'): """f doc string""" |