[issue42455] Add decorator_factory function to functools module

2021-01-05 Thread Nick Coghlan
Nick Coghlan added the comment: Sorry, I meant to include this comment as well: The other filter I applied here was "Could someone figure out the boilerplate code themselves in less time than it would take them to find, read, and understand the documentation for the new helper function?" I'

[issue42455] Add decorator_factory function to functools module

2021-01-05 Thread Nick Coghlan
Nick Coghlan 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

[issue42455] Add decorator_factory function to functools module

2021-01-03 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: I also agree with Raymond's opinion, and from the point that it didn't get much attention I'd assume not many people need it. So count me as -1 -- nosy: +BTaskaya ___ Python tracker

[issue42455] Add decorator_factory function to functools module

2021-01-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: What we should do with this issue? There was no much discussion at python-ideas. I have received only one -1 opinion. -- ___ Python tracker __

[issue42455] Add decorator_factory function to functools module

2020-11-30 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I have posted this idea to python-ideas Link to thread https://mail.python.org/archives/list/python-id...@python.org/thread/OIRAB3QA4AAD3JGH2S5HMGCPDLGG7T52/ -- ___ Python tracker

[issue42455] Add decorator_factory function to functools module

2020-11-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would be nice to include these examples (and more if they exist) in the PR. It will help to see the benefit from the new feature and to test that it does not break anything. I have no opinion yet, but multiple examples can convince me. Or not. --

[issue42455] Add decorator_factory function to functools module

2020-11-30 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Let's wait for Nick. I have found great examples to show how decorator_factory can simplify things. dataclasses.dataclass ``` def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, froze

[issue42455] Add decorator_factory function to functools module

2020-11-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've add Nick so that he can opine. For me, I'm -0 on this one. It does factor-out a common pattern, but I find it less obvious what it does and would not enjoy debugging code that used this decorator. The idea is definitely interesting and worth discuss

[issue42455] Add decorator_factory function to functools module

2020-11-29 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- title: Add decorator_with_params function to functools module -> Add decorator_factory function to functools module ___ Python tracker _