Why Everyone is always Talking About Duck Typing in Python.
ฝัง
- เผยแพร่เมื่อ 5 ก.พ. 2025
- What is duck typing? And what is the difference with static typing? In this video you get the answer to that question and as a bonus you will see how to give your objects superpowers by implementing magic methods.
ENROLL OR PREVIEW THE FULL COURSE:
🎓 PYTHON DATA MODEL - SPECIAL METHODS IN CLASSES: pythonforevery...
C H A P T E R S
0:30 Duck typing example
2:00 Difference with statically typed languages
3:05 Benefits of duck typing
4:10 Type compatibility without formal interfaces
5:20 Combining duck typing and magic methods
#pythonforeveryone #ducktyping #python
Great explanation! Thanks
Thanks!
The pythonic way is so cool. Thanks.
It really is!
can you make a video on piping concept used for project delivery
Do you mean like a build pipeline and continuous delivery?
@@python-for-everyone yes you got me right 🫂💕
Suppose you need to use a 3rd party library's method which requires a object duck. but you have no idea what methods this duck object need to have. In your test it might run ok, but for other it might raise an error!
Libraries might expect your objects to support certain special methods. An example is Django's dataclass, that will use your object's __str__. But it is unlikely that 3d party libraries will expect arbitrary methods where there is no fallback on a baseclass implementation.
Tamil la teach pannunga sir
ivanga foriegn la irukaanga ivangaluku tamil la theriyathu
Where do these mofos come from😂😂
Tamil shut has gotten to your head, eff u nd ur dmk leaders, they are the reason behind all this