Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python multiprocessing Events vs Theading Events

According to the python 2.7.3 documentation multiprocessing.Event is a "clone" of threading.Event. However when I use the following code:

from multiprocessing import Event
test = Event()
test.set()
test.isSet()

However I get this error:

AttributeError: 'Event' Object has no attribute 'isSet'

What gives? why doesn't multiprocessing Event have a method to check if it is set?

Edit: Turns out is_set is within multiprocessing Event class... Still the documentation lied

like image 567
Richard Avatar asked Feb 05 '13 17:02

Richard


1 Answers

An instance of Event class has is_set method, try this guy:

test.is_set()

Documentation for is_set

like image 132
swietyy Avatar answered Sep 21 '22 04:09

swietyy