5 ms·
There's always been more than one effective way to do things in Python. The contention otherwise is just some rosy thinking. Heck, decorators were introduced al
by mrtranscendence 5y ago
There's always been more than one effective way to do things in Python. The contention otherwise is just some rosy thinking. Heck, decorators were introduced almost 20 years ago and they're basically just additional syntax for
def foo():
return "hi"
foo = my_decorator(foo)
Similarly for context managers and many other features.
We can go back much farther than that even: why have lists and tuples, when they're basically interchangeable in most cases? Why have list comprehensions when a loop does the job just fine and might arguably be clearer?