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 pitrou
Recipients neologix, pitrou, rhettinger
Date 2013-03-09.11:30:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I don't think you need slicing if you rewrite the patch in another way, e.g.:

for i in range(n):
        waiter = __waiters.popleft()
    except IndexError:

I think this is safe, since notify() must be called with the lock held: another thread shouldn't be able to mutate the waiters list in the meantime.

As for notify_all(), it could be optimized to swap the internal list with an empty one: there's no need to pop the waiters one by one.
Date User Action Args
2013-03-09 11:30:16pitrousetrecipients: + pitrou, rhettinger, neologix
2013-03-09 11:30:16pitrousetmessageid: <>
2013-03-09 11:30:16pitroulinkissue17385 messages
2013-03-09 11:30:16pitroucreate