Richard
Richard

Reputation: 15882

Event.is_set() in python multiprocessing Event and threading Event

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

Upvotes: 9

Views: 4790

Answers (1)

swietyy
swietyy

Reputation: 834

An instance of Event class has is_set method. Try this out:

test.is_set()

Here is the documentation for is_set

Upvotes: 14

Related Questions