multithreading – TypeError: instancemethod object is not iterable (Python)

multithreading – TypeError: instancemethod object is not iterable (Python)

In your code you are using q1.get and q2.get which are function objects. Instead call it with parenthesis:

q1.get()

which will fetch the value from the Queue.

As per the Queue.get() document:

Remove and return an item from the queue. If optional args block is true and timeout is None (the default), block if necessary until an item is available.

Youre passing Queue.get [the function] to caesar instead of the value from calling Queue.get().

Add some () and you should be fine. 🙂

multithreading – TypeError: instancemethod object is not iterable (Python)

Related Posts

Leave a Reply

Your email address will not be published.