|
This 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.
|
|
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.…
|
|
In 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…
|
|
Getters 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,…
|
|
We 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…
|