[Patches] [Patch #101108] getopt.py extensions (APPEND version)

noreply@sourceforge.net noreply@sourceforge.net
Sat, 19 Aug 2000 18:56:02 -0700


Patch #101108 has been updated. 

Project: 
Category: None
Status: Rejected
Summary: getopt.py extensions (APPEND version)

Follow-Ups:

Date: 2000-Aug-07 12:11
By: goodger

Comment:
Extensions to getopt.py, APPEND version*

Frank Stajano <fms@uk.research.att.com> added:
(1) dictionary output function getoptdict(), which returns the options in a dictionary for random access, as opposed to getopt()'s list's sequential access (example usage in libgetopt.tex); and 
(2) specialised exceptions subclassed from GetoptError for fine-grained control.

See http://deja.com/=dnc/getdoc.xp?AN=640434359 for Frank's original post to comp.lang.python.

David Goodger <dgoodger@bigfoot.com>:
(3) reworked Frank's changes; 
(4) made None the argument value for argumentless options, removing ambiguity for 'program
-o ""' (NOTE: possibly backwards incompatible, with "if optarg == '':" instead of "if optarg:"); 
(5) added to command-line test mode; 
(6) wrote test_getopt.py; 
(7) updated libgetopt.tex.

* Why two sets of patches? Frank Stajano abhors repeated options and insists on making REJECT the default behavior for getoptdict() (i.e., repeated options raise an exception). David Goodger feels that APPEND is the appropriate default behavior, and friendlier too. Please use one set; the only difference is the default repeatedopts=REJECT or repeatedopts=APPEND, and its documentation.

REJECT: 101106, 101107, 101110
APPEND: 101108, 101109, 101110

Patch 101110 is test_getopt.py, a new regression test module (for lib/test/) which applies to both REJECT and APPEND versions.
-------------------------------------------------------

Date: 2000-Aug-09 00:27
By: goodger

Comment:
I examined the entire 1.6b1 tarball for incompatibilities, and found only 2 in 90+ modules using getopt.py. Their patches follow (nos. 101126 mimify.py, 101127 lib-old/dircmp.py).
-------------------------------------------------------

Date: 2000-Aug-19 21:55
By: tim_one

Comment:
Rejected.  As discussed on Python-Dev, Guido doesn't want *any* getopt enhancements in the std library at this time, despite that these are very well done.

-------------------------------------------------------

Date: 2000-Aug-19 21:56
By: tim_one

Comment:
Rejected.  As discussed on Python-Dev, Guido doesn't want *any* getopt enhancements in the std library at this time, despite that these are very well done.

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101108&group_id=5470