Re: [BangPypers] Enforcing keyword only arguments

2016-08-10 Thread Praveen Shirali
IMO, No. With Py2, the caller has the freedom to positionally pass values against the kwargs (and with py3 as well, if you remove the '*' after positional args). Hence, if your API is forcing the caller to pass some values only via kwargs, then that's a restriction that's non-obvious and deviates

[BangPypers] Enforcing keyword only arguments

2016-08-10 Thread Sudheer Satyanarayana
Hello BangPypers, Python 3 has this nifty feature of including the * in the argument list to indicate the end of positional arguments and the beginning of keyword-only arguments. For example: def my_func(a, b, *, kw1=None, kw2=None): pass In Python 2 you could achieve the same goal of enforc