In this series, we will go over my notes for Python. And in this video, we are going to cover mutability. We will see how immutable and mutable objects are defined. We will go over different situations where mutability might cause a problem and how to deal with it. And will we see how mutability works when using nested data structures.
Links:
GitHub Repo: https://github.com/SebastianMantey/Python-Tutorial
Full Playlist: https://www.youtube.com/playlist?list=PLPOTBrypY74yHNvmKlf9bfYuwMlbiPk94
Evaluation of default values (starting at 32:22): https://youtu.be/vL_UcDX_xuU
Timestamps:
0:00 - Intro
0:07 - Definition of immutable objects
2:16 - Definition of mutable objects
4:36 - Copying variables that point at a mutable object
7:54 - Passing a mutable object to a function
11:51 - In-place functions vs not-in-place functions
12:59 - Mutable objects as default values in function definitions
19:04 - Changing a mutable object while looping over it
23:45 - Mutability and nesting
24:03 - "no copy"-situation
27:49 - "shallow copy + changing elements of outer list"-situation
31:06 - "shallow copy + changing elements of nested list"-situation
35:37 - "deep copy"-situation
40:52 - Tuples can contain mutable objects
Download
0 formats
No download links available.
Python Tutorial for Beginners p.15: Mutability - Definition & Potential Problems and their Solutions | NatokHD