[issue36772] Let lru_cache be used as a decorator with no arguments

Stefan Behnel report at bugs.python.org
Thu May 2 10:14:31 EDT 2019


Stefan Behnel <stefan_ml at behnel.de> added the comment:

I'm generally ok with such APIs. It seems needless to require

  @lru_cache()
  def f(): ...

when a simple decorator would suffice. I think I might decide otherwise in cases where almost all usages require arguments, but if the no-arguments case is common (and there is no ambiguity in the arguments), then I prefer not requiring parentheses.

----------
nosy: +scoder

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


More information about the Python-bugs-list mailing list