I want to call a instance of a class directly,
for expample-
class A(Object):
def __init(self,temp):
super(A, self).__init__()
self.val = temp
def get_val(self):
return self.val
Now, creating an instance -
my_var = A('something')
print(my_var.get_val())
but i want to print the value only by using -
print(my_var) or print(my_var())
Is this possible?