Still confused about 'self' in Python? Then watch this!

preview_player
Показать описание
Self is a mysterious thing when you start creating classes in Python. In this video you learn why methods have self as first parameter and how Python passes a value for it automatically when calling the method.

D E E P E R D I V E:

C H A P T E R S
0:28 What is self?
0:35 Why does a method have two parameters and when you call the method you only have to pass one argument?
1:29 The instance and the arguments are packed into a method object

F R O M T H E D O C S
"If the name denotes a valid class attribute that is a function object, a method object is created by packing (pointers to) the instance object and the function object just found together in an abstract object: this is the method object. When the method object is called with an argument list, a new argument list is constructed from the instance object and the argument list, and the function object is called with this new argument list."

M Y O N L I N E T R A I N I N G

#pythonforeveryone #programming #self
Рекомендации по теме
Комментарии
Автор

clicked because the thumbnail seems like dostoievsky

natan.mendes
Автор

This was the most dummy proof explanation ever, after 8 youtube videos. This was the one with the eureka moment!!! Thanks Much

EdwinCrown
Автор

This is the best explanation of this that I have found. A lot of times when people make things really simple, they neglect actually explaining something and expect you to understand something just from seeing it. Thanks for making this helpful video!

dasnilpferd
Автор

Best explanation ever, you didn't need to mention unnecessary terminology (which often makes you feel more confused) to perfectly explain the topic. Congrats! and thanks for the help!

davidsanchezsimon
Автор

I started getting the concept before this video but to me this was very well and simply explained, congrats !

bastou_chl
Автор

I LOVE YOU MAN! I have been trying to understand this for so long now without any success. Finally I found you video and understood instantly. Thank you<3

eliaskarlsson
Автор

I watched a video 10-20 minutes long and did not understand anything. Here in 2 minutes I understood everything. Brilliant, thank you!

dimaconaffetto
Автор

Finally an explanation I understand. Thank you!

swedenludvig
Автор

Thank you. Best 2 minute explanation ever.

wesleypresleymusic
Автор

Even with this simple explanation, OOP is still confusing...

brandon
Автор

the perfect time you made a video for me thanks a lot.

ROHITKUMAR-muik
Автор

well done! Looked for an answer all over google but this straight forward tutorial is the best explanations I found! 😄

cescotv
Автор

Just subscribed to this channel so far the explanations are awesome please keep up the good work regards from Chile !

mauricioacuna
Автор

excellent video.. love it ... please keep making these videos...

pratikrajpandey
Автор

Finally found the video where self is explained properly

VAIBHAVMALHOTRA
Автор

Thank you for keeping it simple and short.

greenapetranslord
Автор

After a year i have found the right answer.. bro I really love you... Keep it up.

umaraliarshad
Автор

Well this is explained in a very concise way, deserves a like and subscribe, thanks!

emirzarahman
Автор

that was fantascticly useful. Thanks mate

clemeverett
Автор

glorious explanation. thank you so much!

souravendra