This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ron_adam
Recipients avdd, bquinlan, georg.brandl, r.david.murray, ron_adam
Date 2011-01-18.04:02:33
SpamBayes Score 6.318306e-06
Marked as misclassified No
Message-id <1295323356.43.0.576092350838.issue10918@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-01-18 04:02:36ron_adamsetrecipients: + ron_adam, georg.brandl, bquinlan, r.david.murray, avdd
2011-01-18 04:02:36ron_adamsetmessageid: <1295323356.43.0.576092350838.issue10918@psf.upfronthosting.co.za>
2011-01-18 04:02:33ron_adamlinkissue10918 messages
2011-01-18 04:02:33ron_adamcreate