3 ms·
No metaclasses or descriptors though, still needs some work.
by reinhardt 14y ago
No metaclasses or descriptors though, still needs some work.
- pcote 14y agoOh, you want metaclasses? How about this? print(type("",(),{"__call__": lambda self, start, end: [(n, (lambda x: ("fizz" if x % 3 == 0 else "") + ("buzz" if x % 5 == 0 else ""))(n)) for n in range(start,end+1)] })()(1,50))