I have two instances of Python class (i simplified logic to make it shorter)
class First:
def first_p(self):
print('test')
first_instance = First()
second_instance = First()
Now i need select which one instance to use (i could do it by repeat code in if/else)
if x:
second.first_p()
else:
first.first_p()
But i wander how i can do it like this (it's not working)
'{}'.first_p().format(second)
dictthat maps the strings to the desired objects.