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 Kain94
Recipients Kain94, pitrou
Date 2010-04-21.13:52:44
SpamBayes Score 0.00016031935
Marked as misclassified No
Message-id <1271857965.51.0.00702373681995.issue8486@psf.upfronthosting.co.za>
In-reply-to
Content
> In this case, you don't have to use an Event. A boolean attribute on one
> of your objects is enough.
> (similarly, you would use a "volatile" variable in C)

This is already the case with Event. Look at threading.py @line ~355 Event class has a kinda private attribute _flags which is set/unset right before notifying. Using a boolean would look almostly the same so why to reinvent the wheel ? :)

If you look also at is_set(), it has the same meanings than __bool__() (ie returning True or False according to object's status). My suggest is only to had the following two lines:

def __bool__(self):
  return self.is_set()
History
Date User Action Args
2010-04-21 13:52:45Kain94setrecipients: + Kain94, pitrou
2010-04-21 13:52:45Kain94setmessageid: <1271857965.51.0.00702373681995.issue8486@psf.upfronthosting.co.za>
2010-04-21 13:52:44Kain94linkissue8486 messages
2010-04-21 13:52:44Kain94create