Special Methods || Python Tutorial || Learn Python Programming
ฝัง
- เผยแพร่เมื่อ 9 ก.พ. 2025
- 𝙎𝙩𝙖𝙮 𝙞𝙣 𝙩𝙝𝙚 𝙡𝙤𝙤𝙥 𝙄𝙉𝙁𝙄𝙉𝙄𝙏𝙀𝙇𝙔: snu.socratica.... Socratica Friends, we have a quiet little email group for Python if you'd like to receive updates (can't count on YT for notifications). Sign up here: snu.socratica....
In Python, special methods are those "odd looking" methods that start and end with underscores. They let you override operators, intercept the setting and getting of attributes, customize object serialization, and much more. In this lesson we talk about the idea behind special methods and attributes, how to implement them, and give many examples along the way!
Some of the special methods & attributes we will cover include:
_init_
_doc_
_setattr_
_str_
_getattr_
_getattribute_
We were able to bring you this video thanks to our generous Kickstarter backers! Find their names hidden (okay, not very hidden) in the video!
⧓⧓⧓⧓⧓
Subscribe to Socratica + bell for notifications:
bit.ly/Socratic...
Find our programming playlists here:
Python programming: bit.ly/PythonSo...
SQL programming: bit.ly/SQL_Socr...
⧓⧓⧓⧓⧓
We recommend:
How to Be a Great Student
ebook: amzn.to/2Lh3XSP
Paperback: amzn.to/3t5jeH3
Kindle Unlimited (read free): amzn.to/3atr8TJ
Python Cookbook, 3rd edition
amzn.to/3goRmbG
The Mythical Man Month - Essays on Software Engineering & Project Management
amzn.to/2tYdNeP
Shop Amazon Used Textbooks - Save up to 90%
amzn.to/2pllk4B
⧓⧓⧓⧓⧓
Join this channel to get access to perks:
/ @socratica
Support Socratica on Patreon:
/ socratica
⧓⧓⧓⧓⧓
Python instructor: Ulka Simone Mohanty (@ulkam on Twitter)
Written & Produced by Michael Harrison (@mlh496 on Twitter)
#Python #SpecialMethods #Coding
Wear a Socratica Python shirt for good luck coding: shop.socratica.com/products/python-by-socratica
Now that Ulka is back, my passion for Python and Programming is back.
Indeed
I already know the material, but it's worth watching for the cybernetic presentation.
Please don't stop python series, it's really awesome, ulka is an awesome instructor
she's human or ai?
@@thomasslonsdale6837 ai
Yesyesyesyes
The level of subtle (and not so subtle) sarcasm in just the first minute made me almost roll off my chair. These videos have nothing new to learn for me, but they are so much worth watching nonetheless. Priceless.
Thanks Elmo. Just make sure to assert this statement on your next resume as an achievement / reference.
I've been a Python developer for 6 years but I still enjoy watching these because she makes things more clear.
Now please dont stop this series. I am so much in love with python again
I used to think I was a visual learner.
Now i know I'm a Socratica learner.
Thank you for these videos.
AAAAHHHH this is the most beautiful comment. 💜🦉
Socratica Friends, we have a quiet little email group for Python if you'd like to receive updates (can't count on YT for notifications). Sign up here: bit.ly/PythonGroup
I am a supporter 🙂
Signed...plz Give us latest python ML Work with your magic..
Brilliant!
Your sense of humor, voice, coding environment and the way you are introducing this content is pretty impressive!
Hope to see new Python videos soon.
Ulka is the main reason I followed Socratica! Please don't stop Python series!!
I enjoy the humor as well as the information in these videos. Very well done.
So glad this series started again and so happy to see that your channel is regular now. Thank you!
Well, your “Methods” for teaching python is really “Special”.
This makes things much clearer for me. Ulka is a great instructor
This series is excellent: funny, entertaining and pedagogically brilliant. You're doing an amazing job in this series (and others I imagine), thank you : ) !!!
yay, the python fairy is back, welcome, welcome
Oh my God. I did not realise these tutorials were back. So happy about this. I am a lot more experienced than I used to be, and am writing code for my job everyday. But I find these so entertaining
she is just amazing in how she simplified the content, thank you for the lessons 😊
1.24 .."Because nobody got time for that" , always a pleasure listening and learning through this channel
We dont need any special "compare" methods, because we know for sure, that "Socraticas" videos are simply the best!!! Thank u for making things clear & interesting
You are an absolutely amazing teacher, thank you
Gotta love how concise yet comprehensive these tutorials are
Python evolves so quickly.
Thanks for the usual amazing explanation.
This isn't new. I'm not sure but unless they dramatically changed how their language works, this should be about as old as python classes are.
Not sure if this what you meant with python evolves so quickly.
I've been teaching for quite some time now, but I am yet to see any surpass this straight to the point and effective way of teaching.
I have a huge respect for you mam....
I have learnt python from you.... 🙏🙏🙏
This indeed is, a special video 😜
As someone who is teaching python to themselves, this was really useful to finally understand what is going on with the dunderscore. Most of my objects just store attributes, so this video helps me realize how I can use my custom objects more wisely. Thank you!
i love these. gives me the same tingly feeling as strategy game tutorials from wayyy back
she is back 🎉🎉🎉
I never write comments on TH-cam but for you I will make an exception. Very happy you are back, this is, by far the best tutorial series on python that I have ever seen.
You are so kind, thank you!! We really love making these videos. 💜🦉
they summarized my coding basics class of 1 yr into a 12 min video
@@MySachincool really??
Wait a second... Are these great Python videos back ??? Yeah !!! 👌
we really hope you get time to make more of these awesome python videos, can't get enough of your content. thanks
Oh, there will be Python... Much more Python.
Missed this channel man !
As always, the best examples and the best clear explanation of such an amazing feature. Thanks Ulka and thanks Socratica.
Ulka taught me Python in 2020. Welcome back!!! 😊 🙏🏻
Well done, Thank You.
There is something special about your videos.
Loved it. Really helped understand how it all works. Love the humour.
Very on point no bs, not wasting time, very good!
best tutorial videos about python. no bullshit whatsoever
Thanks!
Thank you for your kind support!! 💜🦉
These videos are great
There are two people who taught me the fun aspects of Python, Socratica and Bucky Roberts (The New Boston).
Bucky stopped doing his videos suddenly so that leaves Socratica
Edit
Bucky Roberts is back!!
Now we have two awesome fun places to watch Python videos on!
This is SO Powerful!, Well Explained!! awesome LESSONS
Thank you @Socratica for bringing Ulka back for more python programming tips!
Glad to see u after a long time
I love these videos with teacher Ulka. 😍
please make more videos on Python..just love your videos,, so informative and interesting ..I fell in love with Python from watching your videos.... great inspiration
So glad your back with Video! A Class of their own! #Best
Good to see you again!!!!!
this serie never gets old nor boring for me
God damn, I am quite new to programming and what is being said makes sense. But deploying these methods as quickly as the video, that's a while away for me. Nice channel anyway.
Socratica is special to me. Thanks.
Soooo happy to see Ulka again 🥳🤩
As usual - really cool content!!!! thank you))
Wish I could give more than one thumbs-up.
I share your videos a lot, though, so maybe I do vicariously.
Keep up the good work! Will join soon!
Best video on this topic !
Best 👍🏻 video 💗💗 thanks for making video on python
World's best presentation
Well done, thank for the great effort at every video
Thnx a lot 😍 ...have been waiting for a long long time. Please keep continue.... We appreciate min 1 Python video/month. Givin u stenngth through comment 🥰🥰
Stay strong, kind Socratica Friend! More on the way! 💜🦉
Thanks for making video 💗💗💗💗
"Thorough this video I will not pronounce the leading underscores because nobody got time for that"
This line killed me XD
I love this channel so much
Very nice. Really shows some OOP concepts in Python.
I don't know why, but anytime I watch your video, I understand faster then my university lecturer
Hey
Please am I beginner
Can I work together with you??
OMG... I got what I was looking for ❤️❤️
So glad she is back
Yayyyy! Its back!
Excellent work as always!
Thank you for the great video
I just came here to leave a 'like'! Thank you for these series of videos! Last year, they were a huge help to me to learn Python.
As always, great content!
Awesome Channel 😀 thank you !!
The accent, the attire, the background, make me imagine. Some advanced AI tutor 🤔
These videos are pretty great
Welcome back 💐 Ulka
I watched her video something 2 yrs back..
And she is still same wow
Special video on special method by a special person ! :)
Special methods
In a Python tutorial.
Ulka's back,
With sarcasm for you all.
Learn some Python
And have a laugh too.
With dunder and magic
Comin through.
Such a great channel on TH-cam?
Who knew!
Welcome back!
Welcome back 🤘🤘
Your back!!!
Love it, Thanks!
ULKA stands for Ultra Learning & Knowledge Acquisition.
glad to see you back hahaha
after a long time.. me is waiting..
Ulka is such a gem.
Ulka is very special..
Just as I start to rewrite my C++ to Py3.7..... yeah! There has been no clearer instructor of programming than I can recall. In just a few videos, I've learned more Python than from all 5 books I have. Oh, yeah: I learned how to code on an IBM punched-card machine. Typos were a pain in more than your seated position! You only want to try one for the novelty of the ancient world of the automatic abacus.
Oh my god you are back
Hi Socratica:
I have a question - I tried to use the __lt__() magic method to so the comparison with class object and the called sort().method; however, the sorted results seem to be dependent on __reprt__() and therefore returned instead of what specified in __str__() method.
Could you please tell why this happened?
I love the channel and a big supporter. I guess this question is for everyone. Is there a program similar in style to the Monte Carlo but instead of random i could plot each point myself. My point being, I am an ex athlete and I see so many possibilities with this concept. A x y grid can be Football, Baseball practically any sport. How many times does the QB throw to Quadrant 1 or 4 etc etc..thanks
Nice 👍
Are you planning on covering other languages, this format works very well for learning!
After long time .. !
Oh your back
a masterpiece
Thanks for the trophy!
You are special!
Hello my dear teacher i have a confusion question about special method specialy __hash__ there are both in tuple and list function but when i did a reseach on google its said that hash method is used to compare keys in just in dict and tuple because there are fast data structure O(1) but list is so slow its ots compute the lookup for element in O(n) can you plzz explain me why list is so slow for adding and removing items ?