text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
Harry so what have I done I've not
7,352.4
5.48
bothered instantiating an object of type
7,355.079
6.281
hat I am just accessing a class method
7,357.88
5.359
inside of the Hat class that you know
7,361.36
4.48
what is just G to work this is how class
7,363.239
4.241
methods work you use the name of the
7,365.84
3.68
class capital letter in all
7,367.48
4.8
do method name passing in any arguments
7,369.52
4.48
you want python is going to
7,372.28
4.359
automatically pass in some variable via
7,374
5.639
which you can refer to that class in
7,376.639
4.6
that function that you've implemented
7,379.639
3.44
inside of that class so that I can do
7,381.239
3.88
something like this it's not that I want
7,383.079
4.12
a variable called houses locally in this
7,385.119
3.681
function I want the variable called
7,387.199
3.801
houses that's associated with this
7,388.8
5.919
current class so I can still access this
7,391
6.56
same list that I defined on line six and
7,394.719
4.561
now if I go back down here to my
7,397.56
4.92
terminal and run python of hat. enter
7,399.28
5.52
Harry is still in Hufflepuff once more
7,402.48
4.56
Harry is still in Hufflepuff once more
7,404.8
5.48
Harry is back in Gryffindor at least
7,407.04
6.639
randomly questions now on these class
7,410.28
6.08
variables or these class methods which
7,413.679
6.241
are in contrast with instance variables
7,416.36
5.96
and instance methods and the one thing
7,419.92
4.48
at least that's a little strange here is
7,422.32
3.64
that even though there's a decorator
7,424.4
4.159
called at class method there is not one
7,425.96
5.96
called at instance method a method is
7,428.559
5.801
just automatically a so-called instant
7,431.92
4.799
method when you define it without any
7,434.36
4.839
decorator can you have a class inside
7,436.719
5.321
another class you can you can Define one
7,439.199
5.201
class inside of another generally
7,442.04
4.159
speaking this isn't done but there are
7,444.4
3.799
cases where it can be helpful especially
7,446.199
4.44
for larger more sophisticated programs
7,448.199
5.601
so yes it is possible good other
7,450.639
5.761
questions the the question was about the
7,453.8
5.359
self do houses when you when we remove
7,456.4
7.319
it we uh and we pass data the variable
7,459.159
8.721
is created itself why we remove the S so
7,463.719
6.601
in the previous examples both of the Hat
7,467.88
4.16
demonstration and also all of the
7,470.32
5.279
student demonstrations we were uh
7,472.04
5.679
creating a student object by calling
7,475.599
4
student capital S open parenthesis
7,477.719
3.96
closed parenthesis with eventually name
7,479.599
4.08
and a house passed in and then we were
7,481.679
4.321
using the d uh the Double underscore
7,483.679
5.721
init method to initialize the self name
7,486
6.559
and the self. housee instance variables
7,489.4
6.08
therein to those respective values in
7,492.559
5.241
this latest version of the Sorting Hat I
7,495.48
4.679
haven't bothered with self anywhere only
7,497.8
5
because conceptually I don't need or
7,500.159
4.801
want there to be multiple hats in the
7,502.8
4.48
world I'm just using the class as kind
7,504.96
5.279
of a container to bundle up this list of
7,507.28
5.24
houses this sorting functionality maybe
7,510.239
4
eventually I'll add more functionality
7,512.52
4.52
to it but that's it and so sometimes you
7,514.239
4.601
can use objectoriented programming in
7,517.04
3.559
this somewhat different way when you
7,518.84
3.879
want there to be functionality but it's
7,520.599
4.56
not specific to any one specific hat
7,522.719
5.601
it's specific to the Sorting Hat
7,525.159
5.48
itself how about one other question now
7,528.32
5.48
on these class variables or methods just
7,530.639
5.04
another way of using objectoriented
7,533.8
3.56
programming but to solve somewhat
7,535.679
3.321
different problem well what's the
7,537.36
4.839
difference between the class hat and I
7,539
6.599
don't know like a function of hat a good
7,542.199
5.081
question so why are we using a class at
7,545.599
4.201
all and not just having a file called
7,547.28
5.399
hat. with a variable called houses and a
7,549.8
5
function called sort like why are we
7,552.679
3.88
adding this complexity in this
7,554.8
3.439
particular case we don't necessarily
7,556.559
4.6
need to I could absolutely go in here I
7,558.239
5.561
could get rid of the class I could uh
7,561.159
5.241
undo this indentation I could get rid of
7,563.8
4.839
this decorator and I could get rid of
7,566.4
5.12
hat Dot and I could just do this and
7,568.639
4.641
additionally let's see let's get rid of
7,571.52
4.28
class here let's get rid of class Here
7,573.28
5.68
and Now run python of hat dopy enter and
7,575.8
4.839
it still works put Harry in the wrong
7,578.96
3.44
house but that's what we H what happens
7,580.639
4.201
randomly that's fine too what we're
7,582.4
3.96
introducing today by way of
7,584.84
3.279
objectoriented programming is just a
7,586.36
4
different way of modeling the world it's
7,588.119
4.161
not really compelling with an example
7,590.36
3.879
like this frankly that's relatively
7,592.28
4.12
simple it's not very complex there's not
7,594.239
3.88