by hprotagonist · 7y ago · 0 comments
def foo(*, x, y):
pass
# you must do this
foo(x=5, y=6)
# you cannot do this
foo(5,6)
# and therefore you also may not
foo(6,5)
This is a little autocratic but the other nice thing is that if you’re finding it really painful to use it means you should probably refactor anyway.Developing C# in rider if you call `foo(a,b)` then it'll display as `foo(from: a, to: b)` in the IDE.
I write my libraries like this because i want to beat my users into being explicit -- thus the "a little autocratic, but.." caveat.