Search for tag: "constructor"

Lesson 28.4 Generator Visualization

Generators look like normal functions, but they do not behave like them. In this video we show how to visualize them, using the Python Tutor.

From  Hannah Lee 59 plays

Lesson 28.2 Iterable Classes

In this video, we show how to make our own iterable and iterator classes. These are actually tightly linked, and you need one to create the other.

From  Hannah Lee 73 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 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 23.2 Operator Overloading

In this video we introduce the primary tool for abstraction in Python. Operator overloading allows us to define additional meanings for any built-in symbol such as + or *. Because Python uses the…

From  Hannah Lee 77 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 69 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 29 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 83 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 82 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 109 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 110 plays

Lesson 20.2 Class Visualization

Now that you know how to define a class, you need to understand how Python processes the definition. In this video, we see that Python handles it in much the same way, that it does function…

From  Hannah Lee 109 plays

Lesson 17.9 Recursion and Objects

Divide-and-conquer is not just limited to sequence types. In this video we show that it works on some objects as well. Specifically, we use it to process a family tree.

From  Hannah Lee 96 plays

Lesson 12.1 Objects Everywhere

The biggest lie that we have told is that there is a difference between classes and the basic types. In this video we show that this is not true, and what ramifications this has for Python.

From  Hannah Lee 95 plays

Lesson 11.7 Mutable Functions

In the past if we wanted to do any significant computation, we needed a a fruitful function. Procedures are limited to testing or printing stuff out on the screen. But in this video we show how we…

From  Hannah Lee 93 plays

CS2110-FA17-15 Session 15

2017-10-13 00:00:00+00

From  mjp337@cornell.edu 187 plays