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__ofa, so it shows up inhelp(Gf.<name>)as the original C++-backed function.- Parameters:
- acallable
Free function to wrap. Its first positional argument is the receiving
Gfinstance.- clstype
Currently unused; kept for signature symmetry with the metaclass call site.
- Returns:
- callable
A function of signature
(self, *args, **kw)suitable forsetattr(cls, name, ...).