text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
and it's even doing some error checking
8,720.359
3.441
to make sure that the name was actually
8,721.88
5.08
passed in meanwhile student is
8,723.8
5.44
inheriting all of that functionality and
8,726.96
4.28
using it by calling the super class's
8,729.24
4
own init method but it's additionally
8,731.24
3.64
taking the house that's presumably
8,733.24
3.44
passed into the student Constructor
8,734.88
4
function and assigning it to its own
8,736.68
4.28
instance variable self. house and
8,738.88
4.16
similarly Professor are restoring in
8,740.96
4.24
self-thought subject the subject that
8,743.04
4.76
was passed into there that one as well
8,745.2
4.88
now how might we use these classes well
8,747.8
4.36
we'll continue to wave our hands with a
8,750.08
3.76
little bit of detail here but if at the
8,752.16
3.279
bottom of this file or any other file
8,753.84
3.96
that Imports this one I could now write
8,755.439
4.281
code like this I could create a student
8,757.8
4.08
variable and assign it the return value
8,759.72
3.679
of the student Constructor call and
8,761.88
4.08
maybe that student is named Harry and
8,763.399
4.96
that student's house for instance might
8,765.96
5.399
be Gryffindor and meanwhile I might do
8,768.359
5.241
something like this professor equals
8,771.359
3.801
professor over here and notice the
8,773.6
4.48
lowercase s on the left capital S on the
8,775.16
4.72
right same for Professor on the left
8,778.08
3.72
lowercase and uppercase on the right
8,779.88
4.16
respectively Professor quote unquote
8,781.8
6.36
seus and how about defense against the
8,784.04
6.68
dark arts will be his subject and
8,788.16
4.48
meanwhile if we want more generically
8,790.72
4.48
just a wizard who at the moment is
8,792.64
4.799
neither student nor Professor teaching
8,795.2
4.119
classes actively we could even do that
8,797.439
4.721
we could do wizard equals wizard in
8,799.319
4.521
capital W on the right hand side of the
8,802.16
2.96
equal sign because it's the name of the
8,803.84
3.84
class and someone like Alin passing in
8,805.12
6.68
only albus's name not a house not a
8,807.68
6.48
subject because in this case he's known
8,811.8
5
only as a wizard meanwhile with each of
8,814.16
4.88
these calls this line of code here will
8,816.8
3.679
ensure that the init method for the
8,819.04
3.64
wizard class is called this line of code
8,820.479
4.441
here will ensure that the init method of
8,822.68
4.2
the student class and in turn the init
8,824.92
3.68
method of the super class wizard is
8,826.88
3.72
called and then lastly on this final
8,828.6
4.839
line of code will this syntax ensure
8,830.6
4.6
that the init method of the professor
8,833.439
3.721
class is called which in turn calls the
8,835.2
5.04
init method of the super class as well
8,837.16
5.72
any questions now on this idea of
8,840.24
5.36
inheritance which is a key feature of a
8,842.88
3.8
lot of
8,845.6
3.759
objectoriented programming languages um
8,846.68
6.44
so is there any situation where because
8,849.359
5.401
uh from what I've seen so far A lot of
8,853.12
3.52
times there's like a lot of nesting if
8,854.76
3.519
you do superar does it go one up is
8,856.64
3.36
there any situation where you know it's
8,858.279
5.521
nested in another class as well um above
8,860
5.72
wizard let's say a really good question
8,863.8
4.04
if you were to have a a super super
8,865.72
4.04
class so your hierarchy is even taller
8,867.84
4.96
than the two levels of uh hierarchy that
8,869.76
5.16
we currently have absolutely but what's
8,872.8
4.04
nice about object-oriented Pro what's
8,874.92
3.519
nice about inheritance as the name
8,876.84
3.479
implies is just as you might have
8,878.439
4.241
inherited certain traits as a human from
8,880.319
4.641
your grandfather and grandmother or your
8,882.68
4.28
great-grandfather or great-grandmother
8,884.96
4.439
some of those properties can actually uh
8,886.96
4.24
trickle down to you so to speak in the
8,889.399
5.201
context of code as well so when you
8,891.2
6.44
descend from another class that is when
8,894.6
6.04
you subass a a super class or a super
8,897.64
5.16
super class you actually do inherit all
8,900.64
3.759
of the functionality not just from one
8,902.8
3.96
level above you but from two or three so
8,904.399
4
you can indeed access some of that
8,906.76
3.24
functionality as well and you can even
8,908.399
3.641
override it if you want some of these
8,910
3.399
classes to behave a little bit
8,912.04
4.48
differently than others other questions
8,913.399
5.561
on inheritance so it's kind of similar
8,916.52
4.12
to the last one but can you have like
8,918.96
4.84
two parents on the same level a really
8,920.64
5.16
good question so there are ways to
8,923.8
5.12
implement uh um descendants from
8,925.8
4.519
multiple parents and there's different
8,928.92
3.12
ways to do this not just in Python but
8,930.319
3.841
other languages we've kept things simple
8,932.04
4.16
here though by having a single uh
8,934.16
4.48
inheritance path a good question how
8,936.2
4.8
about one more question on inheritance
8,938.64
5.56
can we have multiple arguments in
8,941
7.359