16 Mar
2019
16 Mar
'19
6:40 a.m.
On Sat, 16 Mar 2019 01:59:07 +1100 Steven D'Aprano <steve@pearwood.info> wrote:
On Fri, Mar 15, 2019 at 12:25:22PM +0100, Antoine Pitrou wrote:
Yeah, well.... I do think "+=" for lists was a mistake. I *still* have trouble remembering the exact difference between "list +=" and "list.extend" (yes, there is one: one accepts more types than the other... which one it is, and why, I never remember;
Both accept arbitrary iterables, and the documentation suggests that they are the same:
https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types
Perhaps you are thinking of the difference between list + list versus list += iterable?
Hmm, it looks like I misremembered indeed. Thanks for correcting this. Regards Antoine.