3 ms·
These are Java design patterns. Python has different patterns. That's why people say that Factory is natural in Python. Two examples, what i consider (very sim
by beza1e1 15y ago
These are Java design patterns. Python has different patterns. That's why people say that Factory is natural in Python.
Two examples, what i consider (very simple) Python patterns (without fancy names though):
if __name__ == "__main__":
...
def MyDecorator(func):
def wrapper(...):
def my_func(*args, **vargs):
...
return my_func
return wrapper