[issue32001] @lru_cache needs to be called with ()

Éric Araujo report at bugs.python.org
Fri Nov 10 12:30:35 EST 2017


Éric Araujo <merwok at netwok.org> added the comment:

I remember seeing code needed to make a decorator that works with and without parens and finding it quite obscure and confusing for a long time.  When you understand the distinction between, things become clear and simple again.  I like that the stdlib keeps that distinction.

We could change the doc to include an example without parameters.
We may also make sure to call lru_cache a decorator factory, with a glossary link or link to decorator reference doc.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32001>
_______________________________________


More information about the Python-bugs-list mailing list