diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-05-26 18:27:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-26 18:27:35 (GMT) |
commit | b821868e6d909f4805499db519ebc2cdc01cf611 (patch) | |
tree | ae3da900a9fa80bc5098dd4eb3150ebe6e25ac2e /Doc/whatsnew | |
parent | aaf47caf35984e614d93bd8bea5227df55e0e3e6 (diff) | |
download | cpython-b821868e6d909f4805499db519ebc2cdc01cf611.zip cpython-b821868e6d909f4805499db519ebc2cdc01cf611.tar.gz cpython-b821868e6d909f4805499db519ebc2cdc01cf611.tar.bz2 |
bpo-36772 Allow lru_cache to be used as decorator without making a function call (GH-13048)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.8.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a94aba6..1180469 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -291,6 +291,23 @@ where the DLL is stored (if a full or partial path is used to load the initial DLL) and paths added by :func:`~os.add_dll_directory`. +functools +--------- + +:func:`functools.lru_cache` can now be used as a straight decorator rather +than as a function returning a decorator. So both of these are now supported:: + + @lru_cache + def f(x): + ... + + @lru_cache(maxsize=256) + def f(x): + ... + +(Contributed by Raymond Hettinger in :issue:`36772`.) + + datetime -------- |