mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-22 11:04:25 +01:00
italic literal *op=
*
This commit is contained in:
parent
c95ba00160
commit
2155d917df
2
README.md
vendored
2
README.md
vendored
@ -858,7 +858,7 @@ a += [5, 6, 7, 8]
|
|||||||
|
|
||||||
#### 💡 Explanation:
|
#### 💡 Explanation:
|
||||||
|
|
||||||
* `a += b` doesn't always behave the same way as `a = a + b`. Classes *may* implement the op= operators differently, and lists do this.
|
* `a += b` doesn't always behave the same way as `a = a + b`. Classes *may* implement the *`op=`* operators differently, and lists do this.
|
||||||
|
|
||||||
* The expression `a = a + [5,6,7,8]` generates a new list and sets `a`'s reference to that new list, leaving `b` unchanged.
|
* The expression `a = a + [5,6,7,8]` generates a new list and sets `a`'s reference to that new list, leaving `b` unchanged.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user