10.1. Class Dissector¶
import inspect
from viper_toolkit import Dissect
lines = inspect.getsource(Dissect)
print(lines)
def Dissect(method, class_):
'''
Dissect() takes a method and a class, and returns the contents of the function.
Keyword Arguments:
method -- the name of the method being invoked
class_ -- the name of the class object dissected
'''
instance_ = class_
i = f'instance_.{method}'
print(f'class {class_.__name__}(object):')
print("")
e = eval(i)
print(inspect.getsource(e))