Chris Jerdonek added the comment:

I'm not sure of all the implications of this, but it seems like this is a 
relevant piece of information from the docs:

"type= can take any callable that takes a single string argument and returns 
the converted value:"

(from http://docs.python.org/dev/library/argparse.html#type )

In particular, it doesn't seem like it's meant to be supported to be calling 
"type" on an argument (e.g. a default argument) that's not a string.  That's 
what's happening in the code snippet in the first comment above, where the 
default argument is a list.

I haven't thought about this very long, but what would happen if the "type" 
conversion is only called on arguments and default arguments that are strings, 
and otherwise left alone?  It seems like that would at least address the use 
case in the first comment, and maybe the type=open one as well.

Either way, it seems like you still might need to track whether an argument has 
been converted (e.g. if type converts string to another string type).

----------
nosy: +cjerdonek

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15906>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to