Ron Adam <ron_a...@users.sourceforge.net> added the comment:

Here is the whole method for reference...

    def submit(self, fn, *args, **kwargs):
        with self._shutdown_lock:
            if self._shutdown_thread:
                raise RuntimeError('cannot schedule new futures after shutdown')

            f = _base.Future()
            w = _WorkItem(f, fn, args, kwargs)

            self._pending_work_items[self._queue_count] = w
            self._work_ids.put(self._queue_count)
            self._queue_count += 1

            self._start_queue_management_thread()
            self._adjust_process_count()
            return f
    submit.__doc__ = _base.Executor.submit.__doc__


If self and fn are in kwargs, they are probably a *different* self and fn, than 
the self and fn passed to submit!
 
The current submit definition doesn't allow that, and pulling out self, and fn, 
would not be correct either.  

If it's still possible to change the method call signature, it should be 
without asterisks...

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

Then the correct way to call it would be...

    submit(foo, [1, 2], dict(fn=bar))

There wouldn't be a conflict because the args, and keywords, (to be eventually 
passed to fn), are never unpacked within submit.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to