text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
with lists and so many other class as
9,853.04
6.48
well any questions now on operator
9,855.8
6.559
overloading or this example here how
9,859.52
5.32
would you go about creating a function
9,862.359
7.561
for adding a student and a vault for two
9,864.84
7.88
two separate classes how would that be
9,869.92
5.04
possible let me see what happens here I
9,872.72
4.2
don't know off hand let's do this let's
9,874.96
3.56
create a stir and see what happens if I
9,876.92
4.84
add Potter plus a stir stir object yeah
9,878.52
4.879
okay so it would work I'm just figuring
9,881.76
3.88
this out as I go here Eric so just to re
9,883.399
3.641
be clear what I did was I just changed
9,885.64
3.16
Weasley to stir just to see what would
9,887.04
4.96
happen when I add a vault plus a stir
9,888.8
6.04
and it will work theoretically why
9,892
5.84
because so long as the type of value on
9,894.84
6.68
the left has an add method implemented
9,897.84
6.519
other can be any type that you want you
9,901.52
4.879
just have to decide in code what it's
9,904.359
3.761
going to mean conceptually to add a
9,906.399
3.681
vault plus a string which in this case
9,908.12
4.12
probably doesn't make any sense at all
9,910.08
3.68
but it's possible it's going to be the
9,912.24
3.64
operand on the left and I'm inferring
9,913.76
3.599
that I did not know the answer a moment
9,915.88
3.36
ago I'm inferring that because what I
9,917.359
4.641
got was an attribute error here on line
9,919.24
5.64
11 because python did not like this
9,922
5.479
other gallion didn't work but I could
9,924.88
4.72
make it work by figuring something out
9,927.479
3.721
really good question didn't know that
9,929.6
5.08
one myself other questions on operator
9,931.2
5.92
overloading can you define new operators
9,934.68
5.4
in Python I don't think so there is a
9,937.12
6.08
very long but precise list of operators
9,940.08
5.279
that you can overload I do not not
9,943.2
4.56
believe you can assign arbitrary
9,945.359
5.04
characters to be operators in Python uh
9,947.76
4.32
let me defer to Carter in the chat to
9,950.399
3
revoke okay I'm seeing two of my
9,952.08
3.239
colleagues are saying no not possible so
9,953.399
3.281
I'm going to go with my first instinct
9,955.319
3.201
no otherwise that'd be kind of cool you
9,956.68
4.04
could make Emoji do whatever you want to
9,958.52
4.28
how about one final question on operator
9,960.72
4.24
overloading is that the only operation
9,962.8
5.679
you can do uh is a far as like can you
9,964.96
5.88
do a subtraction as well you can you can
9,968.479
5.401
do so many others let me um if Carter
9,970.84
5.72
you don't mind pulling up this URL here
9,973.88
4.64
so this link here special method names
9,976.56
4.44
in today's slides you'll see a long list
9,978.52
3.959
of all of The Operators that you can
9,981
3.439
overload you can do less than equals
9,982.479
4.321
than plus equals minus equals pretty
9,984.439
4.241
much any symbol you've seen me type on
9,986.8
3.519
the screen can be overloaded in the
9,988.68
3.52
context of
9,990.319
4.761
classes so even though today we focused
9,992.2
4.84
entirely on object-oriented programming
9,995.08
3.08
this is a technique that we've been
9,997.04
2.92
using really since the first week of the
9,998.16
3.72
class because indeed those ins those
9,999.96
4.439
stirs those floats those lists those
10,001.88
4.28
dictionaries and so much more we're
10,004.399
3.281
already underneath the hood this whole
10,006.16
4.279
time classes and objects thereof but you
10,007.68
4.32
now as a programmer have the ability to
10,010.439
3.481
create your own classes with your own
10,012
3.64
instance or class variables with your
10,013.92
3.68
own instance or class methods with your
10,015.64
4.4
own properties and even with your own
10,017.6
4.64
custom behavior for operators so
10,020.04
4.359
ultimately you can absolutely continue
10,022.24
5.039
using those simple tuples or lists or
10,024.399
4.761
those dictionaries or other structures
10,027.279
3.881
as well but object-oriented programming
10,029.16
3.6
and with it classes and now these
10,031.16
3.279
objects is just another tool in your
10,032.76
3.88
toolkit and dare say as your code gets
10,034.439
4.321
more sophisticated and your problems get
10,036.64
3.88
bigger you'll find that being able to
10,038.76
3.88
model these real world or even fantasy
10,040.52
4.6
world entities with classes and related
10,042.64
4.48
data and functionality will ultimately
10,045.12
3.84
just allow you to Define code that's not
10,047.12
4.68
just correct but ever well designed as
10,048.96
6.6
well this was
10,051.8
3.76
cs50
10,059.96
3
[Music]
3.4
9.859
[Music]
15.28
6.869
all right this is cs50's Introduction to
24.56
4.799
programming with python my name is David
27.48
3.879
men and this is our week on regular
29.359
4.641
Expressions so a regular expression
31.359
4.961
otherwise known as a Rex is really just
34
4.36
a pattern and indeed it's quite common
36.32
4.12
in programming to want to use patterns
38.36
4.679
to match on some kind of data often user
40.44
4.56