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.

+19 More
From  Hannah Lee 63 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.

+19 More
From  Hannah Lee 78 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…

+19 More
From  Hannah Lee 35 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…

+19 More
From  Hannah Lee 85 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…

+19 More
From  Hannah Lee 84 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…

+19 More
From  Hannah Lee 81 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…

+19 More
From  Hannah Lee 30 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…

+19 More
From  Hannah Lee 91 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.

+19 More
From  Hannah Lee 89 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…

+19 More
From  Hannah Lee 123 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…

+19 More
From  Hannah Lee 122 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…

+19 More
From  Hannah Lee 126 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.

+19 More
From  Hannah Lee 101 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.

+19 More
From  Hannah Lee 107 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…

+19 More
From  Hannah Lee 102 plays

CS2110-FA17-15 Session 15

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

+64 More
From  mjp337@cornell.edu 189 plays