Improve func_gen and use it in more places
Improve func_gen and use it in more places

The motivation was that in a few places
I'd like to be able to use methods instead
of regular methods and I plan to define
a similar wrapper.

SylvainDe/DidYouMean-Python