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: Improved optparse "varargs" callback example
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, gregg.lind, loewis
Priority: normal Keywords: patch

Created on 2008-12-06 23:09 by gregg.lind, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
better_optparse_varargs_example.diff gregg.lind, 2008-12-06 23:09 improved optparse varags callback example.
Messages (5)
msg77185 - (view) Author: Gregg Lind (gregg.lind) Date: 2008-12-06 23:09
In the trunk (r67617) documentation for *optparse* callback example 6
doesn't handle negative number arguments, and fixing it is "left as an
exercise for the reader."  Well, I'm a reader, and I've attached my stab
at it.  Caveat: It relies in trying to coerce the argument into a
float... maybe there's a cleaner way to do it?

(This is my first patch, so I apologize if I've fouled it up in some
way, particularly in the headers of the patch format.)
msg77513 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-10 09:00
The 2.5 documentation is not in .rst, so I remove these versions.
msg77855 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-15 09:08
I've reformatted and rewritten your patch a bit and applied it as
r67788. Thanks!
msg77875 - (view) Author: Gregg Lind (gregg.lind) Date: 2008-12-15 16:48
This patch should also be applied into the py3k branch, probably.  Good
catch on updating rargs, btw.
msg77877 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-15 17:06
Yes, it will be merged to py3k automatically; we normally merge smaller
changes in batches.
History
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48818
2008-12-15 17:06:56georg.brandlsetmessages: + msg77877
2008-12-15 16:48:27gregg.lindsetmessages: + msg77875
2008-12-15 09:08:04georg.brandlsetstatus: open -> closed
resolution: accepted
messages: + msg77855
2008-12-10 09:00:47loewissetnosy: + loewis
messages: + msg77513
versions: - Python 2.5, Python 2.5.3
2008-12-08 02:42:26gregg.lindsetversions: + Python 2.6, Python 2.5, Python 3.0, Python 3.1, Python 2.7, Python 2.5.3
2008-12-06 23:09:37gregg.lindcreate