https://github.com/python/cpython/blob/main/Lib/functools.py...
Here's a simplified version of that code that demonstrates the pattern.
class partial: def __init__(self, func, *args, **kwargs): self.func = func self.args = args self.kwargs = kwargs def __call__(self, *args, **kwargs): return self.func(*self.args, *args, **(self.kwargs | kwargs)) p = partial(add, 5) # -> an instance of partial with self.args = (5,) res = p(4) # -> calls __call__ which merges the args and calls add(5, 4)
But you are also right that the mechanisms in Python are different (on some suitable mid-level of abstraction) for those two.