Gregory Bond wrote:
Thanks Peter, that's a big help.
You're welcome.
I can solve my problem now, but I'm chasing this further in the name of
education, because it seems there is some deep magic happening here that
I don't understand.
Python resorts to deep magic only when it's inevitable,
I'm building a class hierarchy that needs to keep as a class variable a
reference to a (non-member) function, so that different subclasses can
use different generator functions. But it seems Python is treating the
function as a member function because the reference to it is in class
scope
Gregory Bond wrote:
I'm building a class hierarchy that needs to keep as a class variable a
reference to a (non-member) function, so that different subclasses can
use different generator functions. But it seems Python is treating the
function as a member function because the reference to it
Peter Otten wrote:
You are on the right track with staticmethod, but you have to apply it to
fn:
... fn = staticmethod(foo)
Thanks Peter, that's a big help.
I can solve my problem now, but I'm chasing this further in the name of
education, because it seems there is some deep magic