2 ms·
> there's no distinction between args/kwargs At the python level, all named args[0] are kwargs. The reverse is not true in Python 3, although it is in Python 2
by masklinn 9y ago
> there's no distinction between args/kwargs
At the python level, all named args[0] are kwargs. The reverse is not true in Python 3, although it is in Python 2. At the C level, arguments can be exclusively one or the other even in Python 2.
> at least when it comes to a function's __defaults__ attr. An arg can be turned into a kwarg by messing with the __defaults__ attr.
No, an arg can be turned optional by manipulating __defaults__, that is a different (though not quite orthogonal) axis, especially in Python 3 (which supports python-level required keyword arguments).
> - since True/False are aliased to 1/0, you cannot have both 1 and True as dictionary keys.
They are not aliased (`True is 1` will return False) but they are equal and hash identically.
[0] *args notwithstanding