Barry A. Warsaw added the comment: On Sep 12, 2012, at 02:48 PM, Steven Bethard wrote:
>We should not be converting non-string defaults, or the documentation's >description of the type= argument doesn't make sense. Agreed. If we also take RDM's suggestion of reversing the sense of test_type_function_call_only_once(), then patch 15906-3.diff would do this[*], restore the isinstance test of action.default, and retain the fix for the regression noted in this issue's description. >For the string defaults, I can see the argument for not converting them, and >the argparse docs never show them being converted from strings. I thought >there was a discussion somewhere where someone had requested the current >behavior, but I can't for the life of me find that discussion, so perhaps I'm >imagining it... > >In terms of potential for breaking code, I'm not too worried about removing >type conversion for non-string defaults - this never happened before the fix >for #12776 and #11839, so I doubt much code depends on it. I am more worried >about removing type conversion for string defaults - this has worked for a >long time, so there probably is some code that depends on it. Agreed. Removing the conversion of non-string defaults, but retaining the conversion of string defaults is probably the safest course of action. Do we need a new test for conversion of string defaults? [*] Patch is against 2.7, but if we all agree this is the appropriate fix, I will port it to 3.2 and 3.3. ---------- _______________________________________ 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