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.

classification
Title: Queue deprecation warning patch
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: LambertDW, benjamin.peterson, eric.araujo, exarkun, jnoller, matrixise, rhettinger, tleeuwenburg@gmail.com
Priority: normal Keywords:

Created on 2009-03-05 02:02 by tleeuwenburg@gmail.com, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
queue_patch.txt tleeuwenburg@gmail.com, 2009-03-05 02:02
NEWS_patch.txt tleeuwenburg@gmail.com, 2009-03-05 02:08
queue_patch2.txt tleeuwenburg@gmail.com, 2009-03-06 00:22
queue_patch3.txt tleeuwenburg@gmail.com, 2009-03-06 04:35
Messages (13)
msg83180 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-03-05 02:02
A very tiny patch which places a DeprecationWarning inside Queue.empty
and Queue.full
msg83181 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-03-05 02:08
Add comment to NEWS as documented...
msg83182 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-03-05 03:55
Can you make a single patch for Lib/queue.py and Misc/NEWS and remove
any uses of emtpy/full in the standard library including multiprocessing.

Also, for deprecations, it's always nice to have the message suggest an
alternative, something like:  "The empty() method is deprecated and
scheduled to be removed in Py3.2.  Instead, use qsize() or catch a
queue.Empty exception."
msg83183 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2009-03-05 03:59
Unit tests are a great thing as well.  Also, the deprecation warnings
you've added are the really annoying kind.  They refer to users to the
source of the deprecated methods themselves!  A vastly preferable use of
the warnings system is to refer users to the *callers* of the deprecated
methods.  Try passing different values for the stacklevel parameter of
the warnings.warn function until you get a warning that is more helpful.
msg83229 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-03-06 00:22
Patch covering all files in a single patch.
  * Updated warning message
  * Updated multiprocessing tests to avoid calls to empty and full
  * Placed deprecation warning in multiprocessing methods
  * Update wsgui to avoid deprecated calls

Issues:
  * Noticed no warnings raised as a result of changes to
multiprocessing: ergo multiprocessing.queue empty() and full() methods
are not currently getting test coverage
  * No obvious test rig for wsgui, so code is completely untested (!),
but I figured someone closer to wsgui could at least have my code for
reference, so included in the patch
msg83230 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-03-06 00:25
Hi JP,

I experimented with stacklevel but to be honest nothing I saw appeared
greatly more useful than the default for the tests in question.

What form would the unit tests take? Trying to assert that empty() and
full() raised a deprecation warning? I'm not sure how I would go about that,
but I'll see what I can do.

Thanks,
-Tennessee

On Thu, Mar 5, 2009 at 3:00 PM, Jean-Paul Calderone
<report@bugs.python.org>wrote:

>
> Jean-Paul Calderone <exarkun@divmod.com> added the comment:
>
> Unit tests are a great thing as well.  Also, the deprecation warnings
> you've added are the really annoying kind.  They refer to users to the
> source of the deprecated methods themselves!  A vastly preferable use of
> the warnings system is to refer users to the *callers* of the deprecated
> methods.  Try passing different values for the stacklevel parameter of
> the warnings.warn function until you get a warning that is more helpful.
>
> ----------
> nosy: +exarkun
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5420>
> _______________________________________
>
msg83231 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2009-03-06 00:45
Quote:
Issues:
  * Noticed no warnings raised as a result of changes to
multiprocessing: ergo multiprocessing.queue empty() and full() methods
are not currently getting test coverage

? I need to check this.
msg83233 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-06 01:37
You should test that the warnings are given by the deprecated methods.
Look at test_py3kwarn for an example of how to do that.
msg83236 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-03-06 04:35
Now, with unit tests... :)
msg97012 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-12-29 23:34
It's too late now for deprecation in 3.2...
msg140070 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-09 14:37
I think the docstrings of empty and full should mention they’re obsolete, to make users of pydoc or other tools aware of the deprecation before they write code using them.
msg216373 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2014-04-15 19:54
No news for 2 years.
msg216489 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-04-16 16:29
Martin von Löwis successfully lobbied to keep these methods.
History
Date User Action Args
2022-04-11 14:56:46adminsetgithub: 49670
2014-04-16 16:29:30rhettingersetstatus: open -> closed
resolution: rejected
messages: + msg216489
2014-04-15 19:54:47matrixisesetnosy: + matrixise
messages: + msg216373
2011-07-09 14:37:21eric.araujosetnosy: + eric.araujo
messages: + msg140070
2011-03-09 02:09:27terry.reedysetnosy: rhettinger, exarkun, benjamin.peterson, LambertDW, jnoller, tleeuwenburg@gmail.com
versions: + Python 3.3, - Python 3.1
2009-12-29 23:34:43benjamin.petersonsetmessages: + msg97012
2009-03-06 04:35:39tleeuwenburg@gmail.comsetfiles: + queue_patch3.txt
messages: + msg83236
2009-03-06 01:37:33benjamin.petersonsetmessages: + msg83233
2009-03-06 00:45:17jnollersetmessages: + msg83231
2009-03-06 00:42:03jnollersetnosy: + jnoller
2009-03-06 00:41:19tleeuwenburg@gmail.comsetfiles: - unnamed
2009-03-06 00:33:38rhettingersetassignee: rhettinger -> benjamin.peterson
nosy: + benjamin.peterson
2009-03-06 00:25:34tleeuwenburg@gmail.comsetfiles: + unnamed
messages: + msg83230
2009-03-06 00:22:58tleeuwenburg@gmail.comsetfiles: + queue_patch2.txt
messages: + msg83229
2009-03-05 04:31:49LambertDWsetnosy: + LambertDW
2009-03-05 03:59:58exarkunsetnosy: + exarkun
messages: + msg83183
2009-03-05 03:55:29rhettingersetassignee: rhettinger
messages: + msg83182
nosy: + rhettinger
2009-03-05 02:08:50tleeuwenburg@gmail.comsetfiles: + NEWS_patch.txt
messages: + msg83181
2009-03-05 02:02:35tleeuwenburg@gmail.comcreate