On Mar 2, 8:29 am, Veloz <michaelve...@gmail.com> wrote: > Hi all > I'm looking for a queue that I can use with multiprocessing, which has > a peek method. > > I've seen some discussion about queue.peek but don't see anything in > the docs about it. > > Does python have a queue class with peek semantics?
Am curious about your use case? Why peek at something that could be gone by the time you want to use it. val = q.peek() if something_i_want(val): v2 = q.get() # this could be different than val Wouldn't it be better to just get() the value and return if you don't need it? val = q.peek() if not something_i_want(val): q.put(val) Raymond -- http://mail.python.org/mailman/listinfo/python-list