would it be a good idea to rename/alias the existing extend
to update
to make things appear more consistent.
as is done for the case of len
, so, for example, in a language like Java, they use,
text.length() // String
rates.length // array of floats
names.size() // ArrayList
which is inconsistent, whereas, Python uses, len(text)
, len(rates)
, …
so, if we say the same thing for list vs set vs dict, should the update keyword be used for all three, again to make things more consistent?
because if order is the concern, so, if we use,
somelist = [1]
somelist.update(1, 2, 3)
then, one might wonder where will these elements be inserted, either at the beginning or at the end.
[1, 1, 2, 3]
[1, 2, 3, 1]
but the same holds true for the existing update
keyword for dictionaries also,
d = {'a': 1, 'b': 2}
d.update({'c': 3, 'e: 4})
one could think, would it update these key-value pairs to the front or to the end.
{'a': 1, 'b': 2, 'c': 3, 'e': 4} # this is what appears to be happening
{'c': 3, 'e': 4, 'a': 1, 'b': 2}
if our list.update
also does the update to the end of the list thing, then would it be a more consistent method than the existing extend
?