On Mon, Oct 29, 2012 at 12:24 PM, Andrew Svetlov <andrew.svetlov@gmail.com> wrote:
On Mon, Oct 29, 2012 at 8:10 PM, Guido van Rossum <guido@python.org> wrote: [Andrew]
I would to see add_{reader,writer} and call_{soon,later} accepting **kwargs as well as *args. At least to respect functions with keyword-only arguments.
Hmm... I intentionally ruled those out because I wanted to leave the door open for keyword args that modify the registration function (add_reader etc.); it is awkward to require conventions like "your function cannot have a keyword arg named X because we use that for our own API" and it is even more awkward to have to retrofit new values of X into that rule. Maybe we can come up with a simple wrapper.
It can be solved easy with using names like __when, __callback etc. That names will never clutter with user provided kwargs I believe.
No, those names have different meaning inside a class (they would be transformed into _<class>__when, where <class> is the name of the *current* class textually enclosing the use). I am not closing the door on this one but I'd have to see a lot more evidence that this issue is widespread. -- --Guido van Rossum (python.org/~guido)