classification
Title: optparse docs say 'default' keyword is deprecated but uses it in most examples
Type: behavior Stage:
Components: Documentation, Library (Lib) Versions: Python 3.0, Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, mallyvai, r.david.murray
Priority: normal Keywords:

Created on 2009-05-13 05:01 by mallyvai, last changed 2009-05-16 11:19 by georg.brandl. This issue is now closed.

Messages (3)
msg87668 - (view) Author: Vaibhav Mallya (mallyvai) Date: 2009-05-13 05:01
The first example, and several subsequent examples later on in the
optparse docs, use 'default' as an argument, even though it's apparently
deprecated in favor of set_defaults. At the risk of overstating the
obvious, this seems to be inconsistent. Even the section on defaults
http://docs.python.org/library/optparse.html#default-values uses the
'default' keyword without stressing its deprecation. It might make more
sense to leave it out of all of the examples altogether, replacing it
with the appropriate set_defaults invocations.
msg87673 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-05-13 10:56
Pesonally I would prefer that the deprication be reversed.  In most of
my optparse use cases it is more convenient than calling set_defaults. 
In fact, I'm not sure I've ever used set_defaults, though I am glad that
it exists since I can certainly envision use cases for it.
msg87880 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-05-16 11:19
I agree with you, and have removed the deprecation notice in r72677.
History
Date User Action Args
2009-05-16 11:19:02georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg87880
2009-05-13 10:56:42r.david.murraysetnosy: + r.david.murray
messages: + msg87673
2009-05-13 05:01:59mallyvaicreate