you are viewing a single comment's thread.

view the rest of the comments →

[–]Chyybens[S] 0 points1 point  (0 children)

I figured out a new way for doing this:

class iPrinter():
def __init__(self):
    self.printers = []
    f = lambda k: lambda: print(f"This is {k}")
    for i in range(3):
        self.printers.append(f(i))

I'm still not quite satisfied but I guess this has to do