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.

Author simonmweber
Recipients docs@python, eric.araujo, ezio.melotti, georg.brandl, simonmweber
Date 2013-11-26.05:14:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385442860.38.0.88263802784.issue19789@psf.upfronthosting.co.za>
In-reply-to
Content
In http://bugs.python.org/issue14864, this line was added to the logging.disable docstring:

To undo the effect of a call to logging.disable(lvl), call logging.disable(logging.NOTSET).

To prevent misunderstanding, I propose that this line be changed to:

Calling logging.disable(logging.NOTSET) will undo all previous calls to logging.disable(lvl).


While the original change was an improvement, it's misleading. "undoing the effect of a call" reads as "undoing the effect of the last call", which implies a stack -- think of text editor "undo" functionality. In other words, the current documentation implies behavior like a context manager:

>>> import logging
# start with all logging enabled

>>> logging.disable(logging.CRITICAL)
#     all logging disabled

>>> logging.disable(logging.WARNING)
#         only CRITICAL enabled

>>> logging.disable(logging.NOTSET)
#     undo; all logging disabled

>>> logging.disable(logging.NOTSET)
# undo; all logging enabled

Since logging.disable is idempotent, we're not undoing *a call*, we're undoing *all calls*.
History
Date User Action Args
2013-11-26 05:14:20simonmwebersetrecipients: + simonmweber, georg.brandl, ezio.melotti, eric.araujo, docs@python
2013-11-26 05:14:20simonmwebersetmessageid: <1385442860.38.0.88263802784.issue19789@psf.upfronthosting.co.za>
2013-11-26 05:14:20simonmweberlinkissue19789 messages
2013-11-26 05:14:19simonmwebercreate