Checkout this video next: kzitem.info/news/bejne/2Gpuupt7foF1pXY
@noursidaoui8278
Жыл бұрын
Clear and straight to the point. I love it! Nicely done!
@arjunnarayanan5474
Жыл бұрын
Superbb, underrated channel
@tiktokspicyfyp9195
Жыл бұрын
This video needs more attention! I love your videos thank you very much!
@christianhdz247
2 жыл бұрын
Thank you so much, I was so confused about how mixins works, this video was amazing!
@pranshupriyam632
8 ай бұрын
Fantastic tutorial. I was struggling with this for so long. Never thought that the concept was this simple!
@python-for-everyone
8 ай бұрын
Thanks for the compliment. I'm glad it helped you!
@bosra11
Жыл бұрын
Brilliant explanation - thank you for sharing!
@ashishaswal7396
4 жыл бұрын
Thanks.. its difficult when you try to read mixin. Now I understand what it meant.
@python-for-everyone
3 жыл бұрын
Happy to help!
@sudarshansinha
Жыл бұрын
Very simply explained. Great.
@RaviGuptak
4 жыл бұрын
Super Thanks for explaining it. You made it super easy.
@python-for-everyone
3 жыл бұрын
Glad it helped!
@unl0ck998
2 жыл бұрын
Brilliantly explained
@python-for-everyone
2 жыл бұрын
Thank you for that great compliment!
@NatalieMonina
3 жыл бұрын
Really good explanation! Thank you very much!
@talhayousuf4599
2 жыл бұрын
i was confused about where mixins fit when we already have inheritence. This video showed the actual concept
@abhishekanand5974
3 жыл бұрын
Nice explanation. Was very helpful! Thank you
@abdussamad8127
2 жыл бұрын
Clear and concise. Thank you so much.
@python-for-everyone
2 жыл бұрын
Thanks for watching!
@deepakpawar5593
3 жыл бұрын
Cool explanation. Was really fed up before watching this.
@random4573
2 жыл бұрын
Thank you very much. I know its a simple concept. But I am a visual learner. Your video helped a lot
@python-for-everyone
2 жыл бұрын
You are very welcome!
@breakersun
2 жыл бұрын
reading books/blogs makes me sleepy. videos are great.
@cristobaljvp
3 жыл бұрын
Thank you so much! Pretty neat and a clear example. Now I'm wondering, what's the point of not inherit from A in the mixin class? Wouldn't that make the mixins useful by itself? Or is it so the sole purpose of the mixing is you to implement the class and nothing more, like it would be for an abstract class? I hope my question makes some sense.
@python-for-everyone
2 жыл бұрын
If you would inherit M from A, you would still have to write the print method in M. You are free to do so of course, but in a dynamic language like Python you are not forced to do so in order to get access to the total variable. I hope that answers your question.
@morebowmore
2 жыл бұрын
Very clear and easy to understand. Thank you !
@python-for-everyone
2 жыл бұрын
Glad it was helpful!
@prajaktateke3575
4 жыл бұрын
Thank you for the explanation👍 you made it very easy.
@python-for-everyone
3 жыл бұрын
Glad it was helpful!
@nikolastamenkovic7069
2 жыл бұрын
Great explanation.
@Prince-ds4zm
3 жыл бұрын
Great Explanation, Thankyou.
@datakhukhua4889
4 жыл бұрын
Perfect explanation 🥰
@python-for-everyone
3 жыл бұрын
Glad you liked it
@AwesomeAsh99
2 жыл бұрын
Dank!
@i_am_a_real_cat1443
3 жыл бұрын
Thanks, god bless you
@python-for-everyone
2 жыл бұрын
Thank you!
@domingosdias5988
3 жыл бұрын
Acompanhando a partir de Angola...
@python-for-everyone
2 жыл бұрын
Bem-vindo ao canal.
@DanielLeachTen
3 жыл бұрын
Thank you!
@python-for-everyone
2 жыл бұрын
You're welcome!
@yt-1161
2 жыл бұрын
Is it only me but I don't see here the difference between usual inheritance and mixin
@varunkmr19
3 жыл бұрын
Thank you.
@python-for-everyone
2 жыл бұрын
You're welcome!
@dylanbardin965
23 күн бұрын
How does M know about the 'total' variable if there is no connection to A?
@python-for-everyone
22 күн бұрын
This is known at runtime with duck typing. You can check out how that works here: kzitem.info/news/bejne/kax8rWuEjnSmhoY
@tomaspyth7017
9 ай бұрын
That's really weird if you come from languages like c++ or java.. nevertheless a very good explanation 👍🏼👍🏼
@python-for-everyone
9 ай бұрын
Thanks. And I agree it is strange coming from C# myself.
@bopeng3299
4 жыл бұрын
nice explaination!
@python-for-everyone
3 жыл бұрын
Thanks! 😃
@jollesracing517
2 жыл бұрын
If anyone is watching this for Java, make sure to keep in mind you can not use multiple inheritance! Instead of your class extending two classes you can extend from a single class and implement whatever interfaces you want!
@python-for-everyone
2 жыл бұрын
If D and E (single) inherit from B and C and implement interface I with the print_total function, D and E would still both need to implement the print_total function. It would lead to the duplicate code you see at the beginning of the video.
@tomaspyth7017
9 ай бұрын
@@python-for-everyonesince java 8 or 9 its allowed to have an interface with default method implementation... Its all spaghetti now.. but AI will soon end all that shit🤦🏿♂️🤦🏿♂️😂
@clearthinking5441
3 жыл бұрын
How would one know apriori that a method will be 'important' enough to require creating a mixin?
@python-for-everyone
2 жыл бұрын
That is a good question. I start using a mixin as soon as I notice (too much) duplicate code in subclasses. I don't think there is a one-size-fits-all when it comes to mixins.
@TheLogicDesigns
3 жыл бұрын
Sorry, wondering if someone could explain to me why you couldnt just create a print_total() method in A? Wouldnt that solve the same issue without having to create Class C?
@samuelgunter
3 жыл бұрын
in this example, classes A, B,and C are provided by some foreign library that we cannot directly modify
@dennohnjogu4028
2 жыл бұрын
Does it mean class m is abstract?
@python-for-everyone
2 жыл бұрын
Technically M is not abstract. But since it makes no sense to instantiate M, it is functionally abstract. Python will not enforce this however.
@mrdanisaur
3 жыл бұрын
Great vid! btw, what pen is that? I need one...
@python-for-everyone
3 жыл бұрын
Thanks for the compliment! The pen is a Pentel Sign Pen. They are very good.
@amirhosseinfalahati4388
4 жыл бұрын
Thanks
@python-for-everyone
3 жыл бұрын
You are welcome
@nikitayasnev
Жыл бұрын
как же ужасно объясняют такие простые вещи =_=
@chriskeo392
Жыл бұрын
Tried and failed to explain it to me Good try
@python-for-everyone
Жыл бұрын
Where are you stuck? Maybe I can answer your questions.
@chriskeo392
Жыл бұрын
@@python-for-everyone I think it was just your case in example here. I was looking for examples of Sqlalchemy mixins. Maybe an example using dataclasses as well.
Пікірлер: 68