1def my_function():
2 pass
3
4class MyClass(object):
5 def method(self):
6 pass
7
8print(my_function.__name__) # gives "my_function"
9print(MyClass.method.__name__) # gives "method"
10
11print(my_function.__qualname__) # gives "my_function"
12print(MyClass.method.__qualname__) # gives "MyClass.method"