Search for tag: "subclass"

Lesson 27.10 Model Classes

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…

From  Hannah Lee 54 plays

Lesson 27.8 Application Design

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…

From  Hannah Lee 59 plays

Lesson 27.3 The GameApp Class

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…

From  Hannah Lee 85 plays

Zoom Nov. 12. Dynamic Typing

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…

From  Hannah Lee 31 plays

Lesson 25.5 Custom Error Types

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.

From  Hannah Lee 60 plays

Lesson 25.3 Error Types and the Call Stack

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…

From  Hannah Lee 65 plays

Lesson 25.1 Error Types

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.

From  Hannah Lee 71 plays

Lesson 24.2 The isinstance Function

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.

From  Hannah Lee 69 plays

Lesson 24.1 Strict Typing

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…

From  Hannah Lee 60 plays

Zoom Nov. 5. Inheritance

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…

From  Hannah Lee 20 plays

Lesson 23.7 Class Methods

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…

From  Hannah Lee 81 plays

Lesson 22.5 Name Resolution

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…

From  Hannah Lee 59 plays

Lesson 22.4 The Subclass Hierarchy

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…

From  Hannah Lee 66 plays

Lesson 22.3 The object Class

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.…

From  Hannah Lee 72 plays

Lesson 22.2 Subclass Definitions

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.

From  Hannah Lee 61 plays

CS2110-FA17-04 Session 04

2017-08-31 00:00:00+00

From  mjp337@cornell.edu 257 plays