On 13Nov2022 10:08, Cameron Simpson <c...@cskk.id.au> wrote:
On 13Nov2022 07:57, Cameron Simpson <c...@cskk.id.au> wrote:
# replace fctory with a function calling factory.__func__
factory = lambda arg: factory.__func__(classmethod, arg)
It just occurred to me that you might need to grab the value of
factory.__func__ first:
factory0 = factory
factory = lambda arg: factory0.__func__(classmethod, arg)
Otherwise the closure might introduce a recursion.
Or avoid the closure:
from functools import partial
......
factory = partial(factory.__func__, classmethod)
to produces a partially filled in function.
Cheers,
Cameron Simpson <c...@cskk.id.au>
--
https://mail.python.org/mailman/listinfo/python-list