Search for tag: "constructor"
Lesson 28.4 Generator VisualizationGenerators 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
63 plays
|
|
Lesson 28.2 Iterable ClassesIn 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
78 plays
|
|
Zoom Nov. 12. Dynamic TypingOur 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
35 plays
|
|
Lesson 23.7 Class MethodsOperator 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
85 plays
|
|
Lesson 23.2 Operator OverloadingIn 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
84 plays
|
|
Lesson 22.6 Method OverridingSubclasses 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
81 plays
|
|
Zoom Oct. 29. ClassesIn 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
30 plays
|
|
Lesson 20.9 Optional ArgumentsUnlike 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
91 plays
|
|
Lesson 20.8 The None ValueWe 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
89 plays
|
|
Lesson 20.7 IntializersIn 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
123 plays
|
|
Lesson 20.3 Classes and AttributesThe 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
122 plays
|
|
Lesson 20.2 Class VisualizationNow 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
126 plays
|
|
Lesson 17.9 Recursion and ObjectsDivide-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
101 plays
|
|
Lesson 12.1 Objects EverywhereThe 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
107 plays
|
|
Lesson 11.7 Mutable FunctionsIn 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
102 plays
|
|