A Python style preference I'm rapidly deriving is as soon as there's more than two arguments to a function, especially when you're mixing in args with defaults, I'm thinking about enforcing kwarg syntax only at a language level. Just to force the code to be more readable at the call site.<p>E.g.,<p><pre><code> def bla(self, a, b, c=2, d=True):
self.bla("x", "x", 3)
</code></pre>
Ain't no way in hell I'm wanting those arguments to be used positionally by callers. They're getting THE KWARG IS MANDATORY STAR.<p><pre><code> def bla(self, *, a, b, c=2, d=True):
self.bla(a="x", b="x", c=3)
</code></pre>
It adds more vertical to your code when you have meaningful argument names, but it makes it a lot clearer what is what, and the language enforces what just used to be a good style.<p>It's especially important when Python's mocking comes into play.<p>In languages like Java, you can determine what is what based on types... (with static imports for both)<p><pre><code> X x = new X(mock(Y.class));
</code></pre>
Makes it far clearer what X is working with than<p><pre><code> x: X = X(MagicMock())</code></pre>