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 Jonathan Haigh
Recipients Anthony Sottile, BTaskaya, Jonathan Haigh, berker.peksag, paul.j3, rhettinger, strjan
Date 2020-06-09.13:20:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591708845.41.0.456186136262.issue40365@roundup.psfhosted.org>
In-reply-to
Content
>> But I wonder, was this situation discussed in the original bug/issue?
>Doesn't look like it:

I was looking at the wrong PR link. This has more discussion: https://github.com/python/cpython/pull/13305.

nargs is discussed but I'm not sure it was realized that the nargs=None and nargs="?" cases would act in the way seen here rather than acting like append.

Having a default nargs of "+" was suggested but that suggestion was not addressed.

> I suggest that the default nargs for extend should be "*" or "+" and an exception should be raised if nargs is given as "?".

I'm not convinced about that any more. Using append's behaviour is probably more reasonable for nargs=None and nargs="?".
History
Date User Action Args
2020-06-09 13:20:45Jonathan Haighsetrecipients: + Jonathan Haigh, rhettinger, berker.peksag, paul.j3, Anthony Sottile, BTaskaya, strjan
2020-06-09 13:20:45Jonathan Haighsetmessageid: <1591708845.41.0.456186136262.issue40365@roundup.psfhosted.org>
2020-06-09 13:20:45Jonathan Haighlinkissue40365 messages
2020-06-09 13:20:45Jonathan Haighcreate