1 import operator 2 3 class C: 4 def f(self): pass 5 6 c = C() 7 print c.__name__ # C 8 print c.__oname__ # __main__ 9 print C.__name__ # C 10 print C.__oname__ # __main__ 11 print c.f.__fname__ # f 12 print c.f.__oname__ # __main__.C 13 print C.f.__fname__ # f 14 print C.f.__oname__ # __main__.C 15 16 # If it were defined, operator.__name__ would be module. 17 18 print operator.__mname__ # operator 19 20 # If it were defined, operator.add.__name__ would be function. 21 22 print operator.add.__fname__ # add 23 print operator.add.__oname__ # operator.binary