As a bonus, this even works for methods: # I've changed the name of whoami2 to whoaminow class c: def foo(self): print whoaminow() inst = c() inst.foo() bar = inst.foo bar() #OUTPUTS foo bar