I've poked around at the PyObjC innards quite a bit trying to figure this out. Is it possible to access Objective-C's hidden SEL _cmd
method argument when writing a Python method? It's got to be generated at some point, but I'm not sure if that point is one at which my Python code can get to it.
I was mostly interested in this in order to be able to make an easy PyObjC NSLog
text macro:
def meth_(self, arg):
NSLog(u"%s called" % _cmd)
although I have found other ways to do this kind of logging in Python (see Jeremy's answer), so at this point it's become curiosity about the PyObjC bridge.