Search for tag: "getter"
Lesson 24.4 Duck TypingThis partial typing from the previous video has a name. It is called duck typing. In this video we show both why this is so popular among Python programmers and also why it is so controversial.
From Hannah Lee
78 plays
|
|
Lesson 23.8 Properties (OPTIONAL)This video introduces an advanced topic that is completely optional and will not appear on any exam. Classes like RGB and Point3 appear to enforce their invariants without any getters and setters.…
From Hannah Lee
34 plays
|
|
Lesson 22.8 Subclass InitializersIn this video we show that thte primary purpose of the super function is in the initializer method of the subclass. That is because we cannot guarantee that all of the attributes for the parent class…
From Hannah Lee
79 plays
|
|
Lesson 21.6 Immutable AttributesGetters and setters have another advantage in that they allow us to completely disable to any changes to an attribute. This allows us to separate attributes into mutable and immutable attributes,…
From Hannah Lee
98 plays
|
|
Lesson 21.4 Invariant EnforcementWe know how to enforce preconditions, but how do we force invariants for our attributes? As we see in this video, we do it much the same as for preconditions. But that is because we are going to…
From Hannah Lee
115 plays
|