mail.python.org
Appending to []
a = [].append('x').append('y').append('z'). would be possible with a containing the resulting list ['. x', 'y', 'z']. That is the way I expect any append to behave.
a = [].append('x').append('y').append('z'). would be possible with a containing the resulting list ['. x', 'y', 'z']. That is the way I expect any append to behave.
Next message (by thread): [Python-Dev] About [].append == [].append.More information about the Python-Dev mailing list.
f(list(a).functional_append(4)). Sure there is, just not as a list method. Python is a programming language, you can write any function you like: def functional_append(L, extra): """Return a new list consisting of extra appended to the items of L.""" return L + [extra]. Now call it like this
Next message (by thread): [Python-Dev] About [].append == [].append.More information about the Python-Dev mailing list.