[Python-3000] Useless methods in Queue module

John Barham jbarham at gmail.com
Fri Jan 11 20:43:34 CET 2008


On Jan 11, 2008 11:16 AM, Aahz <aahz at pythoncraft.com> wrote:

> On Fri, Jan 11, 2008, Raymond Hettinger wrote:
> >
> > I proposed to remove three methods from the queue module, qsize(),
> > empty(), and full().  These are not reliable.  The RightWay (tm) is to
> > trap the Empty and Full exceptions or use the .join() approach.
>
> Although I'm not going to advocate for retaining them, I see them as
> mildly useful for logging purposes (especially qsize()).

I've personally found qsize() to be useful, even essential, as if it
was over some threshold it indicated my program was deadlocked. ;)
Knowing when that condition occurred, and logging it, was crucial to
fixing the bug.  I didn't care so much about the exact value as that
it was far too big.  So qsize() IMHO should stay, empty() and full()
can go.

  John


More information about the Python-3000 mailing list