Maybe I should have known this about Python by now, but… Little did I know (was wishing for it today), but there IS a way to specify that arguments MUST be keyword only. >>> def foo(a,b,*,c,d): … print(a,b,c,d) … >>> foo(1,2,3,4) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: [...]
Archive for December 8th, 2009
Python has keyword only parameters!
Posted in Engineering, Technique, tagged keyword arguments, programming, Python on December 8, 2009 | Leave a Comment »