[Python-3000] Useless methods in Queue module

Guido van Rossum guido at python.org
Mon Jan 14 20:59:15 CET 2008


Sounds like we have all-round agreement. Go for it.

On Jan 14, 2008 11:55 AM, Raymond Hettinger <python at rcn.com> wrote:
> > I'm not sure people who ignore the big "Because of
> > multithreading semantics, this is not reliable" warnings
> > should be catered to. Since others have contributed use-cases
> > for qsize()'s advisory information, it should probably stay around.
>
> I concur.
>
> I do recommend we dump q.empty() and q.full().  The right way is to trap the Empty and Full exceptions.  If needed qsize() is available to make your own less reliable checks.
>
> More than just simplifying the API, the improvement makes it easier to roll your own Queue (like a priority queue style).  Currently, we require that six methods get overridden (_init, _empty, _full, _qsize, _put, and _get).  It would be nice to lower the burden to just the basic four.
>
>
> Raymond
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list