|
Through the semester, you have essentially been writing application controllers. In the final assignment, you will need to do that again. But you will also be creating your own models this time. In…
|
|
Game applications (and graphical applications in general) can get pretty complicated. In this video we talk about how to break up your code to make it more readable and more manageable. In some…
|
|
In this video we introduce the GameApp class, which is a class written by your instructor. In the last assignment you will be creating a subclass of the class to run your game. This video highlights…
|
|
Our last presentation on classes reviews the issue of typing, and why this has become much trickier with the introduction of subclasses. This is the last material covered in the second exam.The…
|
|
Now that we can raise an error of any type, it is time to make our own error types. In this video we show that this is incredibly simple, and needs almost no code.
|
|
After the last video, try-except looks less like an if-else statement and more like an if-elif-else statement. As we see in this video, this has profound effects on how errors interact with the call…
|
|
In this video we revisit error messages in Python and show how to read the error type. This type is a class, which means that you can construct your own error objects.
|
|
In this video, we show that we can solve the problem of strict typing by using the isinstance function. This function will be our preferred way for enforcing preconditions going forward.
|
|
Whenever we have enforced preconditions, we have always used the type function. In this video we show why that is a problem, particularly when we want to use an object argument that is a subclass of…
|
|
In this presentation, we continue with several of the classes that we worked on last time. But this time, we create subclasses of them.On the exam, the class question will always be a two-parter. One…
|
|
Operator overloading is not the only important abstraction tool. In this video we introduce the concept of class methods, which are necessary to add new constructors to a class. These new…
|
|
We have long said that the dot (.) in Python means “inside of the folder”. But which folder? In this video, we show why subclasses makes this question a little less clear. When Python…
|
|
Since every class other than object must be a subclass of another class, this can lead to some interesting “family trees” of classes. In this video we look at Kivy classes, and see how…
|
|
Every class must be a subclass of something, and that parent class goes inside of the parentheses. That means that the word object we have been using in all of class definitions is actually a class.…
|
|
In this video we show how to define a subclass. It is exactly the same as defining a class, except that now we actually do something with the parentheses in the function header.
|
|
|