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 paul.j3
Recipients paul.j3, rhettinger, strjan
Date 2020-04-22.19:26:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587583608.2.0.638995294593.issue40365@roundup.psfhosted.org>
In-reply-to
Content
This is a consequence of Python's own definition of append vs extend

In [730]: alist = []                                                                                   
In [731]: alist.append('astring')                                                                      
In [732]: alist                                                                                        
Out[732]: ['astring']
In [733]: alist.extend('astring')                                                                      
In [734]: alist                                                                                        
Out[734]: ['astring', 'a', 's', 't', 'r', 'i', 'n', 'g']
In [735]: alist.extend(['astring'])                                                                    
In [736]: alist                                                                                        
Out[736]: ['astring', 'a', 's', 't', 'r', 'i', 'n', 'g', 'astring']

Normally 'add_argument' doesn't check for valid parameters, but some Action subclasses do their own checking, 

'extend' inherits the nargs==0 test from 'append'. (extend just modifies the __call__, not the __init__ method.

But I wonder, was this situation discussed in the original bug/issue?
History
Date User Action Args
2020-04-22 19:26:48paul.j3setrecipients: + paul.j3, rhettinger, strjan
2020-04-22 19:26:48paul.j3setmessageid: <1587583608.2.0.638995294593.issue40365@roundup.psfhosted.org>
2020-04-22 19:26:48paul.j3linkissue40365 messages
2020-04-22 19:26:48paul.j3create