Raymond Hettinger added the comment:

It may seem pointless to hold the lock, but it is guaranteed behavior (and has 
been so for a very, very long time).

'''
    # Override these methods to implement other queue organizations             
                                                  
    # (e.g. stack or priority queue).                                           
                                                  
    # These will only be called with appropriate locks held   

    # Initialize the queue representation                                       
                                                  
    def _init(self, maxsize):
        self.queue = deque()

    def _qsize(self):
        return len(self.queue)

    # Put a new item in the queue                                               
                                                  
    def _put(self, item):
        self.queue.append(item)

    # Get an item from the queue                                                
                                                  
    def _get(self):
        return self.queue.popleft()
 
'''

----------
versions:  -Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24411>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to