I want to take more arguments depending on the data type of another argument.
class Enemy:
def __init__(self, img, img_size, animation)
???
If I give the class an img
, I want the class to accept img_size
as another parameter but I also want it to not accept animaton
as an parameter. But if I give it animation
, I want the class to not need to accept img
and img_size
as parameters.
The difference between img
and animation
is that img
should be an object from an Image
class, and animation
should be a dictionary. So how would I vary the amount of arguments that I accept depending on what they are?