Message126449
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. |
|
Date |
User |
Action |
Args |
2011-01-18 04:02:36 | ron_adam | set | recipients:
+ ron_adam, georg.brandl, bquinlan, r.david.murray, avdd |
2011-01-18 04:02:36 | ron_adam | set | messageid: <1295323356.43.0.576092350838.issue10918@psf.upfronthosting.co.za> |
2011-01-18 04:02:33 | ron_adam | link | issue10918 messages |
2011-01-18 04:02:33 | ron_adam | create | |
|