4 ms·
Ok, I'll bite. Why does time.sleep(secs) not accept keyword arguments, but def foo(x): print(x) accept `foo(x='I accept keyword arguments!')`
by jonnycomputer 5y ago
Ok, I'll bite. Why does time.sleep(secs) not accept keyword arguments, but
def foo(x):
print(x)
accept `foo(x='I accept keyword arguments!')`
- falcolas 5y agotime.sleep is implemented in C. For Python, adding keyword arguments to functions implemented in C takes a not-insignificant amount of additional boilerplate, so its often not done.
- jonnycomputer 5y agoAh, of course. Posting before my morning coffee. (: