[New-bugs-announce] [issue10918] **kwargs unnecessarily restricted in API

Adrian Dries report at bugs.python.org
Sun Jan 16 16:49:52 CET 2011

New submission from Adrian Dries <adries at gmail.com>:

An API such as in, e.g. futures:

   def submit(self, fn, *args, **kwargs):

cannot be used thus:

submit(foo, 1, 2, fn=bar)

I can see two options: either mangle the named parameters:

    def submit(__self, __fn, *args, **kwargs):

Or fiddle with *args:

    def submit(*args, **kwargs):
        self, fn = args[:2]
        args = args[2:]

components: Library (Lib)
messages: 126367
nosy: avdd
priority: normal
severity: normal
status: open
title: **kwargs unnecessarily restricted in API
type: behavior
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list