Search for tag: "underscore"
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
|
|
Lesson 23.5 Mixed-Type OperatorsOperator overloading allows us to redefine the meaning of + or * on objects of our class. But sometimes we want to mix together types like a fraction and integer. In this video we show that it is…
From Hannah Lee
76 plays
|
|
Lesson23.4 The is OperatorAs 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
56 plays
|
|
Lesson 23.3 Object EqualityPreviously when we compared objects, we compared them attribute-by-attribute. That is because the meaning of == on objects is less clear. As we show in this video, that is because equality (and the…
From Hannah Lee
88 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
80 plays
|
|
Lesson 22.3 The object ClassEvery 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
79 plays
|
|
Lesson 21.6 Immutable AttributesGetters and setters have another advantage in that they allow us to completely disable to any changes to an attribute. This allows us to separate attributes into mutable and immutable attributes,…
From Hannah Lee
93 plays
|
|
Lesson 21.5 Data EncapsulationIn 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
104 plays
|
|
Lesson 20.10 Representation MethodsWhen we first introduced objects, we talked about the concept of object representation. But how does Python know how to use this representation. In this video, we see that this is the result of…
From Hannah Lee
79 plays
|
|
Lesson 9.10 Conditional ScriptsThe only difference between a module and a script is how you run it. But we have seen Python files that do different things when you run them as a script or import them as a module. This is done with…
From Hannah Lee
63 plays
|
|
Lesson 2.2 Assignment StatementsNow that we have some idea of what a variable is, it is time to start creating them. We do that with assignment statements, which are the subject of this video.
From Hannah Lee
134 plays
|
|