46 karma · joined May 1, 2015 (11y ago) · 17 submissions
comment 9y ago · link · parent
>>> def f(*x): print(x[-1])
>>> f(range(300))
299
And surprisingly, in python 2.7, I was able to define a function that takes more than 255 arguments. But perhaps this only worked because I cheated and used exec. >>> exec("def f(" + ",".join("f" + str(x) for x in range(300)) + "): print(f299)"
>>> f(*range(300))
2992.
How a Polymath Transformed Our Understanding of Information(aeon.co ↗)
1 points · by winterlight · 9y ago · discuss
comment 9y ago · link · parent
comment 9y ago · link · parent
The point of the OP is that among different implementations for the same interface, choose the simplest one unless you have empirical evidence that compels you to do otherwise.
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 11y ago · link · parent