Nick Coghlan <ncogh...@gmail.com> added the comment:
I think the idea is a plausible and well-presented suggestion, but I'm afraid I'm still going to agree with the view that we shouldn't add this. >From a maintainability point of view, *generically* detecting the difference >between "applied without parentheses as a decorator" and "called with >parameters to produce a partial function to be used as a decorator" isn't >quite as simple as just calling "callable(args[0])", since it's entirely >possible for decorator factories to accept callables as parameters. We could >try to document our way around that problem, but we wouldn't be able to >eliminate it entirely. Given the relative rarity of the use case, and the potential for subtle issues when the assumptions of the decorator_factory decorator aren't met, I'm happy to leave this task to inline mostly-but-not-completely-boilerplate code rather than trying to abstract it away. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42455> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com