Тёмный

A simple explanation of super() in Python 

Sebastiaan Mathôt
Подписаться 21 тыс.
Просмотров 47 тыс.
50% 1

(For more, visit pythontutorials.eu !) In this video, I explain the super() function for object-oriented programming (OOP) in Python. There is a lot of myth-building about what this function does, but it's surprisingly simple! In a nutshell, super() make complex multiple inheritance easier, but in most scenarios is identical to explicitly calling base-class functions.

Наука

Опубликовано:

 

4 май 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 167   
@adriandiaz1072
@adriandiaz1072 3 года назад
Oh mannn I was stuck on this for hours just reading articles etc... this is the best video I’ve come across so far!. ASAP Sebbie coming through clutch
@Elia__Holm
@Elia__Holm 3 года назад
Just the same))
@Factory400
@Factory400 3 года назад
It takes a true expert to break this down to bite sized pieces. AWESOME.
@JMH-kw8it
@JMH-kw8it 3 года назад
You are by far one of the best Python teachers on RU-vid. I love the way you broke this down, as well as the delivery. Thanks for doing what you do!
@yashpandey9550
@yashpandey9550 4 года назад
Brilliant explaination. Great job 👍.
@elevenyhz
@elevenyhz 3 года назад
Extremely clear and friendly to python beginners. Thank you Sebastiaan.
@kedarr_
@kedarr_ 3 года назад
this video deserves more views. the explanation is amazing
@kondordv
@kondordv 6 месяцев назад
not everybody what to work and those few of them not in programming...:)
@work9167
@work9167 2 года назад
Wow, I have watched a lot of videos about that theme but this is the easiest explanation I have ever seen
@anujonthemove
@anujonthemove 10 месяцев назад
I think very few people have explained the concept with such clarity!
@asifsiddique9586
@asifsiddique9586 Год назад
Best explainable available on RU-vid
@javadesmaeelpour7833
@javadesmaeelpour7833 3 года назад
Some videos like this are worth more than 100 pages of a book. Kudos to you sir!
@kondordv
@kondordv 6 месяцев назад
Indeed!
@eerik6571
@eerik6571 3 года назад
After spending like 40 minutes trying to work out how it works with no success - you explained it in just like 10... AMAZING!
@amitanand7534
@amitanand7534 4 года назад
Damn, you're an amazing teacher.
@janpapaj1982
@janpapaj1982 2 года назад
You rock, Seb. Some of the finest OOP-related tutorial around! Thanks a lot PS. Subscribed and ready to visit again
@ekenii
@ekenii 3 года назад
ASAP sebbie doing the lords work
@rosscoguitar
@rosscoguitar 2 года назад
By far the best explination of this that I have come across. Thanks very much for taking the time to do this.
@sheikhakbar2067
@sheikhakbar2067 3 года назад
A clear and fun way of explaining abstract topics!
@alfred2153
@alfred2153 3 года назад
Ok now I understand this super() stuff. I was confused at first when I stumbled upon it. Thanks Sebastian!
@chadhovey3208
@chadhovey3208 4 года назад
(1) Additional advantage of super: if base class name changes, descendant code need not change w the updated base class name, it stays as super, so fewer code updates. (2) Diamond inheritance generally a bad idea bc can introduce nasty bugs and storage behavior. Recommend to avoid. (3) I enjoy your videos, thank you.
4 года назад
1) That's a good point. 2) I tend to agree, and I cannot recall ever having used it. 3) :-)
@Sickims
@Sickims 3 года назад
This is easily the best video explaining this topic. I finally understood it. Thanks!
@galbatrollix5125
@galbatrollix5125 3 года назад
Yo dude, you are a certified badass. Your python tutorials are one of the best on the whole youtube.
@SebastianMantey
@SebastianMantey 3 года назад
That’s an amazing explanation. Clear and Concise. Kudos!
@kris_jnr_electrical
@kris_jnr_electrical 8 дней назад
You made my days of python super learning end. I love you
@barsidemen5208
@barsidemen5208 4 года назад
Thanks Sebastiaan! A detailed examination of composition vs inheritance in Python would be very useful with the considerations such as Abstract Base classes etc.
@chadhovey3208
@chadhovey3208 4 года назад
Agreed. Is-a relationships (inheritance) can be overused, and cause has-a relationships (composition) to be overlooked.
@augurelite
@augurelite 2 года назад
There are a few 5 minute vids but I watched this one BC the thumbnail is cool. Very glad I picked this one you explained it so well and I love the examples :) instant sub ;) hahaha
@JeremyFisher
@JeremyFisher 4 года назад
this channel is gold
@shubhjangid7881
@shubhjangid7881 3 года назад
This is something called a crystal clear explanation. Thank You Sir @Sebastiaan Mathôt
@ayelenparis3957
@ayelenparis3957 2 года назад
Finally someone who knows how to explain this! Thank youuuu!
@gregt194
@gregt194 Год назад
This was so well explained, thank you!!
@marwanakram2424
@marwanakram2424 2 года назад
oh my god i think that this is the best video that made it very clear and easy thanks dude
@kondordv
@kondordv 6 месяцев назад
hey man you have a gift, a great teacher to share knowledge in such way that students to understand without any question. I sincerely say that I would like to work with a person like you. Greetings to you!
@kkmahapatra8538
@kkmahapatra8538 2 года назад
Got it in just one go ,thank you man it helped a lot .
@makoadrias6435
@makoadrias6435 Год назад
It really was VERY INFORMATIVE! Thanks Sebas!
@ayushtewari467
@ayushtewari467 3 года назад
Simple and brilliant explanation.
@sauravprashar
@sauravprashar 3 года назад
Best Explanation, Made it really easy to understand
@racrity
@racrity 2 года назад
Genio total! Muchísimas gracias por subir el video, muy clara forma de explicar la función.
@shashvatverma5673
@shashvatverma5673 3 года назад
Ah man this is a difficult topic to understand but I finally got it! Thanks :))
@chrispeters8208
@chrispeters8208 3 года назад
best explanation of super i have seen. will watch more of your vids thx
@prashantgade2460
@prashantgade2460 4 года назад
Awesome explaination .It was pretty helpful
@stephenhiggin9597
@stephenhiggin9597 4 месяца назад
Thanks for this. Tried to watch something on LinkedIn Learning about this and was very confused. This is very clear.
@AndrasSimo-zf8yl
@AndrasSimo-zf8yl 8 месяцев назад
just here to boost the algorithm this video deserves more views!
@BrendanMetcalfe
@BrendanMetcalfe 4 года назад
Thanks! Loving the new videos
@storieswithshantanu84
@storieswithshantanu84 2 года назад
Great explaination. U saved me hours of surfing
@polakpuckstopper
@polakpuckstopper 2 года назад
Superb explanation. Thank you!
@i701Dev
@i701Dev 3 года назад
Great explanation! You have earned a sub!
@svergurd3873
@svergurd3873 9 месяцев назад
Very clear and good explanation!
@alissamiche
@alissamiche Год назад
Very well explained, thank you!
@ijgr11
@ijgr11 3 года назад
Excellent Explanation!!!!
@allisteria5906
@allisteria5906 2 года назад
Fantastic Tutorial.
@noe177a
@noe177a 2 года назад
Excellent video!!!
@Raiden_Amani
@Raiden_Amani 10 месяцев назад
Perfect Explanation. Thank you so much 💖
@Abhishek-bu1eu
@Abhishek-bu1eu 3 года назад
Great explanation. Please Keep Up The GOOD WORK. U are god sent
@darsemana512
@darsemana512 11 месяцев назад
Awesome explaination, thanks!
@JackInTheFrost
@JackInTheFrost 3 года назад
Very well explained, thank you.
@anshjain6293
@anshjain6293 5 месяцев назад
Very well made!
@maya11537
@maya11537 4 года назад
I love the way you teach 👍
@walkswithcedarandmaddy6672
@walkswithcedarandmaddy6672 3 года назад
thank you, friend. this was extremely helpful for me.
@m0b13
@m0b13 Год назад
you are a Genius Educator!
@abdulhalimabdullahi9907
@abdulhalimabdullahi9907 8 месяцев назад
this is the best explanation, thank you very much
@user-db2ug8tr5o
@user-db2ug8tr5o Год назад
Thanks for clarification of this topic
@kclaiborn6257
@kclaiborn6257 3 года назад
Cool explanation for Super!
@alfredoa334
@alfredoa334 2 года назад
Great video!!! Congratulations. Thank you very much!!!
@jackzero5230
@jackzero5230 3 года назад
Brilliant!! you are a Sebastiaan Vettal in python tutorials!
@allisonhazlett1879
@allisonhazlett1879 Год назад
beautiful explanation, thanks a ton!!!
@am8537
@am8537 3 года назад
very explicit video, thank you very much!
@oktayaltunok8777
@oktayaltunok8777 3 года назад
great explanation! now its crystal clear :)
@alpstinger5083
@alpstinger5083 3 года назад
Super duper clear!
@budgetgamerlegion8242
@budgetgamerlegion8242 3 года назад
Very well explained. 👌👌👌👌👌
@deepakranganathan9644
@deepakranganathan9644 4 года назад
Really nice Explanation :)
@muhammadprawirayuda3510
@muhammadprawirayuda3510 2 года назад
nice explaination, really understood
@martian6201
@martian6201 Год назад
I am so late. going to subscribe to your channel not sure if you have more content will check out your account soon. First I want to say your explanations are the best I have ever come across. So im hoping YOU ARE STILL POSTING MORE CONTENT. This is fantastic so very well done. I am now going to subscribe to your channel. Thank you so much Sabastiaan I am ever so grateful for you.
Год назад
Thanks for your comment! I don't post new videos very frequently, that's true But once I find the time and inspiration, new videos will come!
@divasgupta
@divasgupta 4 года назад
What a great explanation...
@ibekwevictor1158
@ibekwevictor1158 Год назад
Thank you ASAPsebbie for this tutorial
@swaysue8076
@swaysue8076 Месяц назад
Hippest python lesson ive recieved by far.
@guntbert9709
@guntbert9709 3 года назад
Great explanation, thank you. Just a small addition in favour of using super() instead of explicit calling: when you (for some reason) choose another superclass it is EASY to forget to change the line with the explicit __init__() call.
3 года назад
Good point !
@iluvsyphonfilter
@iluvsyphonfilter 4 года назад
Very good explanation!
@AcademiaPython
@AcademiaPython 4 года назад
Hi Sebastiaan, nice video btw. I've a question: does the mro apply in this case? So, we have three ways to make inheritance, super(), MRO and explicitly call the __init__ of parent class, is that correct?
@user-xq6bc3jb1l
@user-xq6bc3jb1l 8 месяцев назад
Great content!
@rockNbrain
@rockNbrain 3 года назад
Nice Job!
@jethrotayag1873
@jethrotayag1873 2 года назад
Very clear explanation
@kalik54
@kalik54 3 года назад
Man I love your videos, please dont drop your channel
3 года назад
I have no plans to stop, don't worry! I just don't post new videos very often because I'm busy with other things too.
@kalik54
@kalik54 3 года назад
@ Glad to hear it, thanks for the videos, you helped me a lot :3
@westernfriend
@westernfriend Год назад
Brilliant mate
@emmanuelsheshi1553
@emmanuelsheshi1553 2 года назад
beautiful explanation
@kychemclass5850
@kychemclass5850 Год назад
Would it be correct to think of super() as compiling a "pythonic set" of inits (and perhaps sets of all other inherited methods?) therefore only allowing one occurrence of an otherwise multiplex of the same init???
@hristokaragitliev100
@hristokaragitliev100 3 года назад
Great video, thanks!
@michaelmurphy6687
@michaelmurphy6687 3 года назад
great video. great explanation. i am a new subscriber for sure.
@ranjit9427
@ranjit9427 2 года назад
This is GOLD!!!!!
2 года назад
Glad you like it!
@maximilianogonzalez988
@maximilianogonzalez988 3 года назад
excellent video
@raulpalmaa
@raulpalmaa 2 года назад
super clean explanation
@aaplidhanwantari4589
@aaplidhanwantari4589 2 года назад
amazing explaination
@THOMASKUTTYREJI
@THOMASKUTTYREJI 3 года назад
great explanation .........if possible make a separate playlist for object oriented programming in python
@mafiaboy16
@mafiaboy16 4 года назад
Zuiver man. ik wist van super maar deze informatie was voor mij onbekend
@shamrock6644
@shamrock6644 2 года назад
This is a great video, too many videos just gloss over how super handles multiple inheritance.
@jcsd0
@jcsd0 2 года назад
good work bro
@hassangharahbagheri8850
@hassangharahbagheri8850 Год назад
thank you. it was informative.
@burburchacha
@burburchacha 2 года назад
well explained!
@notion_ogonek
@notion_ogonek 4 года назад
Thank you so much! :)
@the_okoh
@the_okoh Год назад
does the order of the (KanyeWest, ASAPRocky) matter in the ASAPSebbie class? Which of the classes is calling the base __init__() ?
@JonnyRobinson
@JonnyRobinson 11 месяцев назад
Thank you for this.
@ketanbutte3497
@ketanbutte3497 7 месяцев назад
great explanation on super.__init vs using base class .__init__
@pil3driverwaltz164
@pil3driverwaltz164 Год назад
Thank you so much 🙏 subscribed 👍
Далее
Python Decorators 1: The Basics
11:22
Просмотров 40 тыс.
На фейсконтроле 💂
09:41
Просмотров 718 тыс.
super/MRO, Python's most misunderstood feature.
21:07
Просмотров 215 тыс.
SUPER() in Python explained! 🔴
13:06
Просмотров 5 тыс.
Please Master These 10 Python Functions…
22:17
Просмотров 113 тыс.
Python Data Classes Are AMAZING! Here's Why
16:11
Просмотров 75 тыс.
Python tricks: Demystifying async, await, and asyncio
15:59
25 nooby Python habits you need to ditch
9:12
Просмотров 1,7 млн
Berry's Paradox - An Algorithm For Truth
18:34
Просмотров 435 тыс.
Functools is one of the MOST USEFUL Python modules
13:37
Мой новый мега монитор!🤯
1:00
Просмотров 765 тыс.