EDIT: I have found the solution:
class rpartial(partial):
def __init__(self, *args):
self.result = args[-1]
def __repr__(self):
return self.result
Subclass partial, in init give it *args so that it can read from the list of parameters provided, the final argument I provide is accessed with an index of -1 and becomes the result it prints. repr() returns the identification and maya prints it on undo/redo.
— Original post below —
I use a ton of functools.partial and if I undo/redo it looks like variations of:
// Undo: <functools.partial object at 0x000001F6075633B8> //
As opposed to (for example):
// Undo: channelBoxCommand -key //
How do I make it output the proper result?