Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 514 Bytes

5vht-and-with-sequences.md

File metadata and controls

13 lines (10 loc) · 514 Bytes

+ and * with Sequences

#python #programming #language #efficiency

  • It is the operation _add_ and _mul_.
  • a += b is the operation _iadd_. When it is not implemented, the fallback is the _add_
  • _iadd_ is the list.extend(). Is the same for bytearray and array.array.
  • For immutable objects, the _iadd_ is similar to the _add_.

Warning

PERFORMANCE: Append on imutable objects are inefficient

Warning

BUG: Does not put mutable objects on immutable ones.