4 ms·
I find Python inelegant in general but Python's support for keyword arguments strikes the best balance of simplicity and flexibility in any language I've used.
by cageface 15y ago
I find Python inelegant in general but Python's support for keyword arguments strikes the best balance of simplicity and flexibility in any language I've used.
- MostAwesomeDude 15y agoPython's argument conventions are even more flexible; they actually work by passing a tuple of positional arguments and a dictionary of keyword arguments, and unpacking/repacking according to the signature of each function. You can pass any iterable as positional arguments and any mapping as keyword arguments. You can also retrieve the positional and keyword arguments inside a callable as a tuple and dictionary. It's the best calling convention I've ever seen.