OOP in Python - Classes, Objects, class methods, monkey patching & more!

  Рет қаралды 22,399

Socratica

Socratica

2 ай бұрын

𝙎𝙞𝙜𝙣 𝙪𝙥 𝙛𝙤𝙧 𝙎𝙤𝙘𝙧𝙖𝙩𝙞𝙘𝙖 𝘾𝙤𝙪𝙧𝙨𝙚𝙨: www.socratica.com/collections
𝙎𝙤𝙘𝙧𝙖𝙩𝙞𝙘𝙖 𝙋𝙮𝙩𝙝𝙤𝙣 𝙨𝙝𝙞𝙧𝙩: shop.socratica.com/products/p...
In this tutorial on object-oriented programming (OOP) in Python, we use the analogy of making cookies to explain the concepts of classes and objects. This allows you to understand the distinction between classes (cookie cutters) and objects (cookies). We go on to explain how to define classes, create objects, and utilize methods. Additionally, this video covers the use of class attributes, instance attributes, class methods, and instance methods. Special cameo by monkey patching!
𝙋𝙧𝙤𝙜𝙧𝙖𝙢𝙢𝙞𝙣𝙜 𝙥𝙡𝙖𝙮𝙡𝙞𝙨𝙩𝙨:
Python: bit.ly/PythonSocratica
SQL: bit.ly/SQL_Socratica
Subscribe to Socratica + bell for notifications:
bit.ly/SocraticaSubscribe
⧓⧓⧓⧓⧓
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/3jprjX2
More Socratica Python goodies here:
shop.socratica.com/collection...
⧓⧓⧓⧓⧓
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
Edited by Megi Shuke and Michael Harrison
#python #pythonprograming #OOP

Пікірлер: 63
@Socratica
@Socratica 2 ай бұрын
𝙎𝙞𝙜𝙣 𝙪𝙥 𝙛𝙤𝙧 𝙎𝙤𝙘𝙧𝙖𝙩𝙞𝙘𝙖 𝘾𝙤𝙪𝙧𝙨𝙚𝙨: www.socratica.com/collections 𝙎𝙤𝙘𝙧𝙖𝙩𝙞𝙘𝙖 𝙋𝙮𝙩𝙝𝙤𝙣 𝙨𝙝𝙞𝙧𝙩: shop.socratica.com/products/python-by-socratica
@soyuzssr
@soyuzssr 2 ай бұрын
I’m so happy !! A new Socratica Python video dropped !! Please do more such videos - they’re really so helpful !
@omhmpp
@omhmpp 2 ай бұрын
Always happy to see ulka back with a programming video
@egecant
@egecant 2 ай бұрын
Best channel in youtube. I wish you guys made an app so I would use it instead of getting distracted by youtube shorts :D
@Socratica
@Socratica 2 ай бұрын
We're working on a course page as we speak! Thanks for your kind words.
@Allen-by6ci
@Allen-by6ci 2 ай бұрын
Ulka is awesome as usual. Please list her in the credits.
@Socratica
@Socratica 2 ай бұрын
She is! Please visit our illuminating Description box for lots of details.
@mohammadamanalimyzada1462
@mohammadamanalimyzada1462 2 ай бұрын
Please do speed up uploading more amazing videos like this I love the job you guys are doing here and appreciate it from the core of my heart🥰🥰🥰
@Zancb
@Zancb 2 ай бұрын
Yay!!! I'm so happy to see a new video from Socratica!
@ahmetahmed9754
@ahmetahmed9754 Ай бұрын
I'm really amazed by the way they made this video. It tells nothing but their mystery of the concept. The moment you are able to simplify the concept is the moment you earn the master of the concept title. Well done! And I'm glad to be part of the Socratica family.
@TheWyrdSmythe
@TheWyrdSmythe Ай бұрын
A nice concise overview of Python classes in only eleven minutes! 👏🏼👏🏼👏🏼
@Mohammad2525
@Mohammad2525 Ай бұрын
Sent it to some friend and help him a lot. Outstanding explaining like always. You guys are awesome behind and in the front of Socratica Channel.
@flarone
@flarone 2 ай бұрын
This series is really great.
@elmotactics8739
@elmotactics8739 2 ай бұрын
As an App Dev, I will 100% be using "software thingies" to describe what I'm doing now.
@emman100
@emman100 2 ай бұрын
I was thinking of a way to explain what objects are without being technical and yes, I would also call them software thingies. 🤣
@dewaynescott5114
@dewaynescott5114 2 ай бұрын
Thank you so much for these videos. I can’t even express how appreciative I am. Please keep them coming and this format for learning is perfect.
@shawnscientifica7784
@shawnscientifica7784 Ай бұрын
I feel in love with this channel years back and forgot due to life and school and now I'm back? I'm ready to fully invest! This is the kind of learning I would happily pay for!! Just went to your site, will you eventually do more advanced courses? say, an explanation of Topology, or AI/ML Python in this format. I love the scifi theme or any artistic theme it satisfies the artist in me and the Engineer I am by degree is satisfied by the information. You do a holy work here, divine by the universe
@pile333
@pile333 2 ай бұрын
Very well done! 👏
@9jatechie
@9jatechie Ай бұрын
Thanks for the beautiful video and welcome back.
@Socratica
@Socratica Ай бұрын
Thank you Socratica Friend!!! 💜🦉
@AlexanderBukh
@AlexanderBukh 2 ай бұрын
fabulous stuff, thanks!
@joaovazquez7112
@joaovazquez7112 Ай бұрын
Que video legal. Continuem com essa série, por favor, pois muito agradável o aprendizado. Obrigado
@juanmacias5922
@juanmacias5922 2 ай бұрын
Whooo! New Python video. :D
@crackintosh
@crackintosh 2 ай бұрын
I love Socratica!
@angojones3713
@angojones3713 2 ай бұрын
Like button activated, comment section engaged. Ready for takeoff.
@GegeOriloye
@GegeOriloye Ай бұрын
Impressive! Thanks.
@murphygreen8484
@murphygreen8484 2 ай бұрын
Man, those dunder methods are really magical
@techjunk8467
@techjunk8467 Ай бұрын
Understanding OOP makes me smile
@ChakradharrChakrii
@ChakradharrChakrii 2 ай бұрын
Awesome 🎉
@hibryd7481
@hibryd7481 2 ай бұрын
This is very fortuitous; I've had a little spare time and was thinking of playing around with game design, a field in which OOP is applied liberally. I honestly don't use OOP that much and need to brush up, and it seems Python has a somewhat different feature set regarding OOP than other languages I've used in the past. To drift outside the scope of this video and wax on a little bit about design; I'd highly recommend to newer programmers to only utilize OOP when it makes clear and obvious sense to do so. There are schools of thought that OOP is the biggest tragedy to ever befall the programming community, and while I think that's a bit extreme, it has been my experience that OOP gets applied to a *very* wide range of situations where it isn't necessary or appropriate.
@mjkluck
@mjkluck 2 ай бұрын
Good stuff.
@sinaasadiyan
@sinaasadiyan 2 ай бұрын
great video
@israelortiz8820
@israelortiz8820 2 ай бұрын
Welcome back
@JorgeEscobarMX
@JorgeEscobarMX 2 ай бұрын
Very well done, explained. A second part with the explanation of creating and using the dunder methods: __repr__, __str__, etc would be great.
@emman100
@emman100 2 ай бұрын
Those methods have great responsibility attached to them. 😁
@emman100
@emman100 2 ай бұрын
I did not know about monkey patching lol. These Python OOP nicknames are out of control. 🤣
@hellocodeur
@hellocodeur Ай бұрын
Thanks
@emman100
@emman100 2 ай бұрын
Excellent video. I did not know that for self, you can pass in whatever name you want. I will still use self as it is convention but that is quite interesting. It does not seem to be the same for cls though. I started using Python OOP like 2 years ago. They make my code look so clean. 😁
@Omnifarious0
@Omnifarious0 Ай бұрын
I can understand the pleasing symmetry of covering instance methods and class methods. Class methods are generally fairly uncommon though, and it's a lot more common to have static methods. Sadly, those don't fit the pleasing symmetry nearly so well. 😕 Otherwise, as always, I loved your presentation. :-)
@acherongoon
@acherongoon Ай бұрын
I love the videos and would like to use them with students; unfortunately in recent feedback we seem to have an "uncanny valley" effect, highlighted when we studied the effect in robotics... it causes a disconnect with students and to some level a distrust of the information, explanations not being fully recognised.
@user-bz5xt3sc2g
@user-bz5xt3sc2g Ай бұрын
your fitness is amazing you still look same as 6 years back.
@deepdatasoftware2553
@deepdatasoftware2553 Ай бұрын
Thank you Socratica, great material and very nice way of teaching. I am wondering why "introduction" as being a instance method is getting printed when calling "dir(Person)", I would've thought that only class methods will be printed, Do you know why this is happening? Thank you very much in advanced. Regards
@dixztube
@dixztube 2 ай бұрын
i always enjoy coding in python - its a fun language. i guess they each have their enjoyable idiosyncrasy... golang is also fun. js isn't fun to me but the project goals can be made fun. i havent done any ML work but i hear mojo is super cool
@iamjimgroth
@iamjimgroth 2 ай бұрын
It is indeed responsible to create classes.
@waqarkhanpisces
@waqarkhanpisces Ай бұрын
how do you get the idea of this type videos, whenever i visit here i think that a horror movie is being played your hard work is very appreciable
@ChandrashekarCN
@ChandrashekarCN 2 ай бұрын
💖💖💖💖
@CerejaStudies
@CerejaStudies Ай бұрын
pq abandonaram os brs? gostava tanto dos videos
@destinliburd5455
@destinliburd5455 2 ай бұрын
❤❤❤heart
@kellysmith7357
@kellysmith7357 2 ай бұрын
noice
@kirbymarchbarcena
@kirbymarchbarcena 2 ай бұрын
Now I crave for cookies
@Socratica
@Socratica 2 ай бұрын
Us toooo oh no Our friend just sent us a recipe for masala chai shortbread!
@kellysmith7357
@kellysmith7357 2 ай бұрын
orly
@jeffschroeder4805
@jeffschroeder4805 2 ай бұрын
Strange to see your name used in an example. You are welcome!
@lucasgaperez
@lucasgaperez 29 күн бұрын
you never came back to your spanish channel😢
@LanguageHelp
@LanguageHelp 2 ай бұрын
first
@raj-zo4ev
@raj-zo4ev 2 ай бұрын
😂
@king1_one
@king1_one Ай бұрын
bro i am in future and i have a AI teacher.
@benjamingoldstein1111
@benjamingoldstein1111 2 ай бұрын
I must say that the robotic design of the otherwise excellent videos is really distracting.
@okaytokay
@okaytokay 2 ай бұрын
Nah.. you must be new. This is perfect.
@Allen-by6ci
@Allen-by6ci 2 ай бұрын
Ulka is awesome
@benjamingoldstein1111
@benjamingoldstein1111 2 ай бұрын
@@Allen-by6ciThis is naturally very subjective. I could do with fewer sound bits and I'd rather hear a more natural voice modulation. The older videos were not this over-produced. But it's great if you like it the way it is. Just my two cents.
@hibryd7481
@hibryd7481 2 ай бұрын
I think its fun; its definitely preferable to not having any style at all. If you code a lot you know what a slog it can be to wade through endless tutorials with someone just speaking dryly at length over an unedited screencap.
@benjamingoldstein1111
@benjamingoldstein1111 2 ай бұрын
@@hibryd7481Yes, there is a soft spot somewhere in between.
XML & ElementTree  ||  Python Tutorial  ||  Learn Python Programming
10:30
The Noodle Stamp Secret 😱 #shorts
00:30
Mr DegrEE
Рет қаралды 42 МЛН
Mini Jelly Cake 🎂
00:50
Mr. Clabik
Рет қаралды 17 МЛН
Surprise Gifts #couplegoals
00:21
Jay & Sharon
Рет қаралды 31 МЛН
Python Object Oriented Programming (OOP) - For Beginners
53:06
Tech With Tim
Рет қаралды 3,2 МЛН
5 Useful Python Decorators (ft. Carberra)
14:34
Indently
Рет қаралды 79 М.
AsyncIO, await, and async - Concurrency in Python
9:12
Socratica
Рет қаралды 68 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 84 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 785 М.
OOP 1 | Introduction & Concepts - Classes, Objects, Constructors, Keywords
1:42:27
Learn Python Classes With a Text-Based Battle - OOP Tutorial
15:25
Ork Slayer Gamedev
Рет қаралды 122 М.
Python dataclasses will save you HOURS, also featuring attrs
8:50
5 Good Python Habits
17:35
Indently
Рет қаралды 304 М.