#! /usr/bin/python
"""
shows how to print a method name
also shows how to access base method from derived obj
"""

class one(object):
    """
    def __init__(self, name, choice):
        self.name = name
        self.choice =  choice
        self.get_inst()

    def get_inst(self):
        if ( self.choice == 1 ):
            return two( self, self.choice )

    """    
    def __call__(self):
        print("in _-call__")

    def __str__(self):
        print("in _-str__")
        print("Type = ", type(self.__class__.__name__))
        return repr(self.__class__.__name__)
        #return repr( "In __str__")
    
    def get_it(self):
        print("In Base CLass")
        print("Base", self.get_it.__name__)        # How to print a method name


class two(one):
    def run(self):
        print("hey")


def func1():
    print("At Func")
    print("arg => ", arg)

t1  = two()
t1.get_it()
#t1 = one("one", 1)
t1()        # CALLS __call__
print(t1)    # CALLS __str__
#t1().run()
class onemore:
    def __init__(self):
        pass

    def get_arg(self, name, no):
        self.name = name
        self.no = no

    def put_arg(self):
        print("Name =>", self.name)
        print("No =>", self.no)
  
t1 = one()  
#exec(t1.get_it.__code__, {'self':'one()'})
exec(func1.__code__, {'arg':'one()'})
#print (one().get_it.__code__)
                 
a = onemore()
a.get_arg("HAR", 99)
a.put_arg()
