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.

Author barry
Recipients Arfrever, arnau, barry, benjamin.peterson, bethard, chris.jerdonek, georg.brandl, python-dev, r.david.murray
Date 2012-09-12.15:47:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
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.
Date User Action Args
2012-09-12 15:47:21barrysetrecipients: + barry, georg.brandl, bethard, benjamin.peterson, Arfrever, r.david.murray, chris.jerdonek, arnau, python-dev
2012-09-12 15:47:21barrylinkissue15906 messages
2012-09-12 15:47:20barrycreate