error: argument after ** must be a dictionary

bruno at modulix onurb at xiludom.gro
Wed Mar 1 04:59:00 EST 2006


abcd wrote:
> I have class like this...
> 
> import threading
> class MyBlah(object):
>     def __init__(self):
>         self.makeThread(self.blah, (4,9))
> 
>     def blah(self, x, y):
>         print "X and Y:", x, y
> 
>     def makeThread(self, func, args=(), kwargs={}):
>         threading.Thread(target=self.blah, args=args,
> kwargs=kwargs).start()

Shouldn't it be:

def makeThread(self, func, *args, **kwargs):
  threading.Thread(target=self.blah,
                   *args,
                   **kwargs).start()



-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list