triqs.gfs.gf.add_method_helper

triqs.gfs.gf.add_method_helper(a, cls)[source]

Wrap a free function a(self, ...) as an unbound method.

Returns a small closure that calls a(self, *args, **kw) and inherits the docstring and __name__ of a, so it shows up in help(Gf.<name>) as the original C++-backed function.

Parameters:
acallable

Free function to wrap. Its first positional argument is the receiving Gf instance.

clstype

Currently unused; kept for signature symmetry with the metaclass call site.

Returns:
callable

A function of signature (self, *args, **kw) suitable for setattr(cls, name, ...).