I\'m trying to create a game for my little sister. It is a Virtual Pet sort of thing and the Pet has toys to play with.
I created a class Toy and want t
Toy
If you just want to pass a class to a function, so that this function can create new instances of that class, just treat the class like any other value you would give as a parameter:
def printinstance(someclass): print someclass()
Result:
>>> printinstance(list) [] >>> printinstance(dict) {}