What is Polymorphism in Python?
HTML-код
- Опубликовано: 11 фев 2025
- In today’s video we’re going to be learning about Polymorphism in Python. Note that polymorphism is not exclusive to Python, and that the concepts you will learn in this video practically apply to every programming language.
Learn about abstract methods: • @abstractmethod explai...
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels
well done in explaining the concept!
2:39 That’s operator overloading, not polymorphism. Polymorphism is adding values of multiple types to a value of one type (i.e. string + string, string + list, string + bytes)
Thanks for the detailed explanation as you said in the intro I have been using this without knowing the name of it which surprised me. 🎉🎉
Thanks man!
What is meta class would you make a videos
PaymentType works better as a Protocol, in my opinion. But I can see why this wasn't used in the video
Everyone stressing about not having a job and and thinking of everything I can do with it!
no it didn't doing f-string in VSC
Python is misspelt in the description😅
It has been fixed!
This is just inheritance.
Polymorphism means to extend the functionality, which is not being done here at all.
This is Polymorphism. Concept of Polymorphism refers to the ability of different objects to respond to the same method or function call in different ways. Exactly what happens here.
@KaraSuraDraw1 , technically, sure, you're correct. However, I wouldn't use the term here and instead would have simplified this to simply inheritance or method overriding.
The reason I differentiate these is because 25+ years ago (I started programming in 1986) polymorphism was not referenced when talking about inheritance. It's a term that covers to broad an area and causes confusion in junior devs.
Call inheritance and method reuse/overriding just what it is. Simple.
Leave polymorphism to interfacing and actually extending class functionality beyond its original intent.
@@JarheadCrayonEaterahh okey, makes sense. You have more experience then i have, but as far as i know Python does not have explicit interfaces like Java or C#, hence why the title is “polymorphism in python”.
@KaraSuraDraw1 , actually, very good point! I'm not a Python dev. Sure, I know it, but don't use it near as often as other languages.
If Python doesn't have what others do, then absolutely okay with me you simply call that polymorphism!
I stand corrected!
As good as this video gets but whats the point of learning if there are no jobs?
Create your own job
@ecaltroyer Tried doing that as well. Could have saved me 8 years in University if I had know about the current situation.
Learn and start teaching others 😂
get any job. Automate it with python. Don't tell anyone. Get a second job. Repeat.
I know this is mind blowing for some, but you can code without it being a job