Author ncoghlan
Recipients BTaskaya, ncoghlan, rhettinger, serhiy.storchaka, uriyyo
Date 2021-01-05.11:23:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609845840.55.0.170831240592.issue42455@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-01-05 11:24:00ncoghlansetrecipients: + ncoghlan, rhettinger, serhiy.storchaka, BTaskaya, uriyyo
2021-01-05 11:24:00ncoghlansetmessageid: <1609845840.55.0.170831240592.issue42455@roundup.psfhosted.org>
2021-01-05 11:24:00ncoghlanlinkissue42455 messages
2021-01-05 11:23:59ncoghlancreate