Search for tag: "folder"

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 on November 12th, 2020 27 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 on November 8th, 2020 3 plays

Zoom Nov. 3. Object-Oriented Design

In ths presentation, we will spend the time creating several example classes. This is another major part of the next exam.When we work with classes, it is very important to pay attention to…

From  Hannah Lee on November 8th, 2020 3 plays

Lesson23.4 The is Operator

As we saw in the previous video, we cannot trust == if we need to test if two variables refer to the same object folder. In this video we show an alternative operator is, which is safe to use because…

From  Hannah Lee on November 8th, 2020 30 plays

Lesson 22.7 The super Function

Sometimes you do not want to completely override a method. You just want to override part of it, or add a few extra features at the end. In this video, we introduce the super function which allows us…

From  Hannah Lee on November 8th, 2020 31 plays

Lesson 22.6 Method Overriding

Subclasses inherit all of the methods of their parent. But suppose you do not want to use the inherited version of a method, but want to define a new one instead? In this video we talk about the…

From  Hannah Lee on November 8th, 2020 29 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 on November 8th, 2020 26 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 on November 8th, 2020 28 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 on November 8th, 2020 23 plays

Zoom Oct. 29. Classes

In this presentation, we review the class definition. We look at both the syntax (what must be present for the definition to work) and the semantics (how it is processed in Python).Most of this class…

From  Hannah Lee on October 30th, 2020 7 plays

Lesson 21.5 Data Encapsulation

In this previous video we introduced the concept of getters and setters. But how do we force the user to use these when the attribute is so much simpler. In this video we talk about the concept of…

From  Hannah Lee on October 30th, 2020 46 plays

Lesson 20.9 Optional Arguments

Unlike other programming languages, a Python class has only one constructor, If we want to give the user more flexibility when creating objects, we should make certain arguments optional. In this…

From  Hannah Lee on October 27th, 2020 32 plays

Lesson 20.8 The None Value

We have seen the None value used in several previous videos. But in this video we finally introduce it formally. In particular, we show why it is so commonly used in object initialization.

From  Hannah Lee on October 27th, 2020 34 plays

Lesson 20.7 Intializers

In this video, we introduce the most important method definition in any class: the initializer. The initializer is responsible for creating all the attributes so that the user does not need to worry…

From  Hannah Lee on October 27th, 2020 39 plays

Lesson 20.6 Method Visualization

Methods definitions look just like function definitions, but we call them differently. In this video we show how to visualize a method call, and we see just how it differs from a function call.

From  Hannah Lee on October 27th, 2020 36 plays

Lesson 20.3 Classes and Attributes

The primary role of an object is to store attribute variables. In this video we demonstrate the easiest way to add attributes to an object. We see that we can also add attributes to class folders as…

From  Hannah Lee on October 27th, 2020 37 plays