Enchancement suggestion for argparse: intuit type from default

Cameron Simpson cs at zip.com.au
Thu Mar 15 22:18:57 CET 2012


On 15Mar2012 09:28, Roy Smith <roy at panix.com> wrote:
| In article <mailman.665.1331806024.3037.python-list at python.org>,
|  Robert Kern <robert.kern at gmail.com> wrote:
| > Yes. Not all type(default) types can be called with a string to produce a 
| > valid 
| > value. Note that "type=" is really a misnomer. argparse doesn't really want a 
| > type object there; it wants a converter function that takes a string to an 
| > object.
| 
| Orthogonal to my original suggestion, I agree that this is misnamed.  
| I'm +1 on the idea of renaming it to conversion= or something like that 
| (we'd need to keep type= around as a deprecated synonym for backwards 
| compatability).  It's really hard to get your head around "type=open".

"factory"? Anyway, far too late to change this now!
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

all coders are created equal; that they are endowed with certain
unalienable rights, of these are beer, net connectivity, and the
pursuit of bugfixes...  - Gregory R Block



More information about the Python-list mailing list