Summary: In this video, Corey distinguishes between a regular method, class method, and a static method. Firstly, a regular method is the type of method that we are used to seeing since the start of OOP tutorials. It is accessible through both the class and the instance, which means that we can call for the method in both Employee.method() and emp_1.method() they automatically have the instance as the first positional argument, as self. Secondly, class methods are the type of method used when a method is not really about an instance of a class, but the class itself. To create a class method, just add '@classmethod' a line before creating the class method. The class is automatically the first argument to be passed in, and is represented as 'cls' instead of 'class'. This is because 'class' is already assigned to be something else in Python. There are 2 ways of using the class method as far as Corey has shown. First is modifying the class variable. Corey modified the 'raise_amount' class variable using a class method. Just remember that to access a class variable, we have to write 'cls.' before specifying the actual name. For example, as 'cls.raise_amount' as in the video. Second is making an alternative constructor. Sometimes people have information of their specific instances of the class available in a specific format. Corey shows an example of this where first and last names and pay are separated by a hyphen. Corey creates a class method that returns the class with the specific values passed in that are obtained by using split() method to the string passed in. User of the script can now automatically create a new instance without having to parse the string at '-'. Corey then moves on to cover static methods. Static methods are different from regular methods an class methods in that it doesn't have a class or instance that is automatically passed in as a firs positional argument. They can be created by adding '@staticmethod' a line before defining the method. These are methods that have a logical connection to the Class, but does not need a class or instance as an argument. Corey says that it is better to make sure we create a static method rather then class or regular method when we are sure that we don't make use of the class or instance within the method.
Can I conclude that the need to create class method instead of class variable is that modifying the 'raise_amount' can be done outside the Class Employee (in class method) by writing the namespace cls.raise_amount(1.05) but in class variable, we should modify from the Emloyee class itself? That's why we need class method for things that we should/can change without modifying the class coding. To keep it clean?
I paused at 1:17 to checkout video on Decorators which I paused again to checkout video on Closures which I paused, yet again to checkout video on First Class Functions. Glad, I did. Thanks for the awesome videos.
Haha. Sorry for the rabbit hole there. Seems like some of these things can continuously break down into smaller and smaller topics. Glad you enjoyed them though!
I'm broke right now but your tutorials are helping pave the way for me to get out of this situation. Once I get back on my feet I'm going to send some loot to your patreon. Thank you for teaching. These are awesome tutorials.
Thanks! And I can definitely understand money being tight. I don't want anyone supporting outside of their comfort zone. I'm glad to hear you're finding the videos helpful.
Easily the best explanations of Python concepts on any platform ( TH-cam, Udemy, Code with Mosh etc.) Corey has a great ability when explaining something to stay within the scope of the topic. By that i mean he doesn't mentioned anything that would be unfamiliar to someone at that particular level. I've found tutors will throw in advanced topics at a very early stage and throw you complete off. Another helpful aspect of Coreys tutorials is his naming of variables/methods/classes and concepts within code. I've found that tutors will name these similar to the concept they are explaining which has lead me completely misunderstand a subject. I really appreciate your tutorials.
@@balmukundthapa4302 Do you understand the concept of "donation" ? It doesnt conflict logically with "price" of knowledge, which is non-zero, by the way (production cost, +"lost opportunity" in economic sense) Anyway, I was just playing when I wrote my original response.
When I was a beginner, I have watched this video and I learned a couple of things. Now that I have intermediate skills, I see the depth and beauty of this video clearly. I feel like I truly grasped this concept. Thanks Corey!
It has been 5 years, since you uploaded this video, and I bet their is still no video or teacher that explain me this topic better than you have. You are the best!!!
That was beautiful. Such simple and succinct explanation. I have wasted almost 2 hours trying to understand this by reading and nothing I read helped me as much as this video.
dude, this is like the best tutorial out there. I've been trying to understand class methods, and I've just been confused at how other people have taught it, but Corey Schafer's beginner friendly way of teaching and his way of just explaining all the little things just helped me clear out a lot of the rubble for me.
Art McClure other people just make videos blablabla without explaining what the heck they are doing. There's this guy in youtube name TM and he's not even explaining what modules he is importing
Man, I never understood classes and their use until I came across your videos.. They are so easy to understand and you are like the best teacher ever..... Thanks for all your efforts and thank you for these videos.
I am completely stuck on this specific topic for a Python course I am taking. This is the third video I've watched and I must say that your ability to explain these concepts is awesome. Thank you sir!
Hi Corey, I noticed a small mistake at 5:46. When you split the string, you create new strings including the pay variable. If you were to execute the apply_raise() function on that new_emp_1 variable, the function would try to multiply a float by a string, getting an error. We need to convert that string to an integer So that line 34. should read: new_emp_1 = Employee(first, last, int(pay)) Same goes for the subsequent from_string classmethod created using the same way. Great videos by the way, I am learning tons!
Or better yet, you could always check if the payment is a number in the constructor, as it is one of the uses of a constructor, that way you would always have a number no matter how you instantiated it.
I looked for OOP, design pattern tutorial, but none is as good as yours. !! I started from tutorial 1 and can't stop all the way to Tutorial 3 finished !!! TKS, YOU really rock !
I'm a brand new Junior software dev (about 2 weeks in) from a trade background and these are the best videos i have found on OOP even now 7 years later
Mr Schafer you are a great teacher, from one teacher to another. I used to teach math in Venezuela but since this comunist regime was installed I don't make enough money for my daily expenses, so at age 67 I am training myself in python programing and in SQL database to see if I can earn some more money as a developer. I got a PhD in mathematics at Louisiana State University in 1995. I'm now totally broke without medical insurance, surviving at expenses of two of my children who lives and worked in the USA.
Hi Corey, you're a great teacher and everything makes sense.. for some reason I came across with your tutorials and it was a blessing. After 3 videos I am hooked and all shook'd up! - It's like watching a TV series "I’m addicted".
OOP is no more remained difficult after watching these. No doubt, lot of hard-work is done for making these master piece tutorials and hard-work always pays.
Man, you are so articulate. The way you express and articulate the concepts is perfect. I write every word you articulate as definitions of my lines of code.
Had started classes 6 months back, now here to revise and looks like have forgotten nothing. The tutorials are explained so smoothly that the person need not to worry about if he will understand the advanced concepts or not. "COREY'S TUTORIALS ARE SHORT BUT EVERY SINGLE LINE IS LIKE GOLD NO ADDED PROMOTIONS JUST KNOWLEDGE AND KNOWLEDGE".
I know this video has been out for a few years, but I wanted to let you know it is still helping new programmers. I was having a problem with some code that I am writing for college homework and this video helped me solve that problem. Thank you for making these great videos.
Thanks! Very clear explanation. 12:44 I found for myself this syntax when you need a quick True/False check: return True if day.weekday() in {5,6} else False
This was wonderful. Thoroughly enjoyed. I had a lot of confusion about static and class methods and ended up watching many tutorials. None of them was as good as this. You are simply brilliant. Keep up the good work. Thank you so much for the videos. stay blessed.
You are a brilliant teacher - I'm reviewing even introductory classes and getting a whole new deeper understanding of the subjects - Keep it up - you were born to do this!
You seem to anticipate all the questions I have while watching the video. You are a naturally gifted teacher and a credit to the Python community. Thank you so much, sir.
Corey, thank you for putting links to each part of the series in all of the video descriptions. It saves time and frustration, so I really appreciate that!
i was struggling to learn class from ebooks and some other pdf but luckily found your channel , thanks alot for clearing all initial doubts like instance , self , attribute , methods and all ,
Absolutely superb! The videos on OO are clear, precise and easy to understand. Thanks Corey. I plan on watching (and learning more from) all your videos
you are better than 2 weekends in a row .. thanks man .. u know iv been trying to understand this from different sources and i couldnt really grasp the whole concept ,,,now that im watchin ur videos im so impressed, the lesson is short ,clear and straight to the point, its to sophisticated ,, thanks
man I am glad I found your channel .. Amazing explanations..I am a Senior in Computer Science this is nothing new for me but the way you explain it is fantastic ...
Regular Class automatically pass the instance as the first argument and we call that "Self" Class Method automatically pass the Class as the first Argument and we call that "CLS" Static Method don't pass anything automatically and they don't pass instances and or the class
I'm amazed by how easy you make this topic to be understandable for everyone, back in the day i didn't manage to understand what could i do with these, these are top tier explanations, thank you
Hello Corey.. I am a python developer for a close time.. And I have developed many games with pygame, created mini blog, set up sockets and played multiplayer games.. And also deep learning in every section of it.. What I want to say is that.. Untill now, all I could improve after learning classes, was to know the libraries which is also important for me but.. These tutorials are just really enchanced me at the same time I was telling myself what am I missing with python.. I have discovered this channel just 30 mins ago and you are better than anyone I have seen in 5 months.. it is amazing that in the third video you are telling classmethods with a really clear way. This is god level dude. I learned classes coding games.. By teaching myself, because other tutorials were really complicated but this is what I had to see.. i know written a lot, just amazedd
Hi Corey, you are helping a lot. I just figured out why we would use class method : you could do the same with a static method or even a instance method and write the class name when you need it (like "class_name.method") BUT ! - if you do that and whant to change the class name for "class_name_2" you have to edit your *entire* code to replace it one by one. If you used a class method the "cls" argument will just pass the new name without even noticing something changed. THANKS !
You are a great teacher. I've got strayed so much using other (and great) online sources because of the questions that popped up in my mind while studying them. Your videos answer most of those questions, because you consider them as part of your curriculum. And making a great curriculum is the better part of being a teacher. The conception that "anyone who can do it can also teach it" is so wrong.
I've been doing just hobby Python stuff for the last year, and my only experience was coming from scripting in video games (like pixel bots for Diablo II etc) as a kid. I can do some really amazing things that quickly turn into 1500+ lines of global functions + if statements and list iterations, but man I would have saved myself a TON of time and confusion over bugs if I had seen your class videos! Great work.
I was sent off into a rabbit hole of decorators --> closure --> first-class functions Coming back to this video feels like completing all your side-quest before defeating the main boss
Seriously Corey. you are the best. have been through a lot of youtube videos and even udemy course. no one explained things the way you did that too absolutely free. Thank you so much
man.. amazing how useful this is even six years after being published, your explanations are great, appreciate it so much. I'm pretty much starting at the beginning w Python, but your careful usage of, and explanation of, terminology and functionality have helped tremendously :) It's concise and not convoluted, makes me actually WANT to keep learning
The video was way easier to understand than all the other sources I originally came from, even without watching the other parts of the series. Thank you very much!
Wow Corey, your tutorials are amazing. Please continue doing a lot of them you are doing an awesome job! I always struggled to understand OOP concepts in python even with help from various articles and courses that touched on the subject. Now that changed. Not only do I know how, but also WHY to use which type of method or variable. And it's all packed in short and easy to follow videos and reproducible code
Sir, i know you get this a lot, but your tutorials are helping me out so, but so much. You don´t know how much i struggled with the OOP paradigm, and now with your tutorials i´m finally grasping it. As soon as i get some cash in my hands i´l be sure to donate to you, thank you very much sir.
...I think the caliber of insruction You are offering is just as good as anything U.C.L.A., Standord, & Harvard offer. I"m a Purdue graduate and I'm impressed. Thank You! YES, I subscribed.
Summary:
In this video, Corey distinguishes between a regular method, class method, and a static method.
Firstly, a regular method is the type of method that we are used to seeing since the start of OOP tutorials. It is accessible through both the class and the instance, which means that we can call for the method in both
Employee.method()
and
emp_1.method()
they automatically have the instance as the first positional argument, as self.
Secondly, class methods are the type of method used when a method is not really about an instance of a class, but the class itself. To create a class method, just add '@classmethod' a line before creating the class method. The class is automatically the first argument to be passed in, and is represented as 'cls' instead of 'class'. This is because 'class' is already assigned to be something else in Python. There are 2 ways of using the class method as far as Corey has shown.
First is modifying the class variable. Corey modified the 'raise_amount' class variable using a class method. Just remember that to access a class variable, we have to write 'cls.' before specifying the actual name. For example, as 'cls.raise_amount' as in the video.
Second is making an alternative constructor. Sometimes people have information of their specific instances of the class available in a specific format. Corey shows an example of this where first and last names and pay are separated by a hyphen. Corey creates a class method that returns the class with the specific values passed in that are obtained by using split() method to the string passed in. User of the script can now automatically create a new instance without having to parse the string at '-'.
Corey then moves on to cover static methods. Static methods are different from regular methods an class methods in that it doesn't have a class or instance that is automatically passed in as a firs positional argument. They can be created by adding '@staticmethod' a line before defining the method. These are methods that have a logical connection to the Class, but does not need a class or instance as an argument. Corey says that it is better to make sure we create a static method rather then class or regular method when we are sure that we don't make use of the class or instance within the method.
Keep up the good work! Read all your post so far
Can I conclude that the need to create class method instead of class variable is that modifying the 'raise_amount' can be done outside the Class Employee (in class method) by writing the namespace cls.raise_amount(1.05) but in class variable, we should modify from the Emloyee class itself? That's why we need class method for things that we should/can change without modifying the class coding. To keep it clean?
Not all heroes wear capes, MAN YOU ARE GREAT
yeah, but sometimes i see some source codes. static method have self as parameter
Your writing is very clear and helps me understand the video, thank you man
He actually knows what to teach,
Unlike most of paid courses.
agreed
Yep, I bought the Code with Mosh python course and in it he does a terrible job explaining classes.
I paused at 1:17 to checkout video on Decorators which I paused again to checkout video on Closures which I paused, yet again to checkout video on First Class Functions. Glad, I did. Thanks for the awesome videos.
Haha. Sorry for the rabbit hole there. Seems like some of these things can continuously break down into smaller and smaller topics. Glad you enjoyed them though!
I did the same thing lol
ilyas khlifa kerfa unindent the 'return true' by on level
Sorry can't understand but if I had to guess, use 'return True' & 'return False' instead of what you're using.
class Employee:
def __init__(self, first, last, pay):
self.first = first
self.last = last
self.pay = pay
@staticmethod
def is_workday(day):
if day.weekday() == 5 or day.weekday() == 6:
return False
return True
emp_1 = Employee('corey', 'shafer', 5000)
emp_2 = Employee('test', 'Employee', 6000)
import datetime
my_date = datetime.date(2016, 7, 11)
print(Employee.is_workday(my_date))
True
>>>
thanx a lote ser i m greatful
I'm broke right now but your tutorials are helping pave the way for me to get out of this situation. Once I get back on my feet I'm going to send some loot to your patreon. Thank you for teaching. These are awesome tutorials.
Thanks! And I can definitely understand money being tight. I don't want anyone supporting outside of their comfort zone. I'm glad to hear you're finding the videos helpful.
Man your comment inspired me to check my bank account once a while ! :)
What condition are you in now?
Hi Max, I am the Internet and I am here to keep you accountable, can you give an update on your situation? Seriously
@@@MMABeijing hahahhahaha
Easily the best explanations of Python concepts on any platform ( TH-cam, Udemy, Code with Mosh etc.) Corey has a great ability when explaining something to stay within the scope of the topic. By that i mean he doesn't mentioned anything that would be unfamiliar to someone at that particular level. I've found tutors will throw in advanced topics at a very early stage and throw you complete off. Another helpful aspect of Coreys tutorials is his naming of variables/methods/classes and concepts within code. I've found that tutors will name these similar to the concept they are explaining which has lead me completely misunderstand a subject. I really appreciate your tutorials.
At least have some ads. You are too good to handle. I'm feeling guilty for watching these videos for free.
😂 for real!
So donate, you cheap fuck.
@@bwatspro lmao
Knowledge should be free of cost.
@@balmukundthapa4302 Do you understand the concept of "donation" ? It doesnt conflict logically with "price" of knowledge, which is non-zero, by the way (production cost, +"lost opportunity" in economic sense) Anyway, I was just playing when I wrote my original response.
I cann't imagine you make this tutorial free for public. This is the best videos over the internet I think. Thank you man. You are great.
When I was a beginner, I have watched this video and I learned a couple of things. Now that I have intermediate skills, I see the depth and beauty of this video clearly. I feel like I truly grasped this concept. Thanks Corey!
Agree, after spending whole a year of learning from different sources. I just realized how the depth and beauty of this video
It has been 5 years, since you uploaded this video, and I bet their is still no video or teacher that explain me this topic better than you have. You are the best!!!
A year on and that is still the case. These tuts are simply the best overall - clear up soo much of the confusion.
@@ZsoltPal23092011He's back :D
Your python tutorials are the best
Thanks, June! Glad you found them helpful :)
That was beautiful. Such simple and succinct explanation. I have wasted almost 2 hours trying to understand this by reading and nothing I read helped me as much as this video.
dude, this is like the best tutorial out there. I've been trying to understand class methods, and I've just been confused at how other people have taught it, but Corey Schafer's beginner friendly way of teaching and his way of just explaining all the little things just helped me clear out a lot of the rubble for me.
Your videos make more sense and are easier to understand than anybody else!
I agree with you!
Art McClure other people just make videos blablabla without explaining what the heck they are doing. There's this guy in youtube name TM and he's not even explaining what modules he is importing
Can't agree more !
Hey Corey, You are awesome. I see the hard work you have put through these videos and sharing the fruits of your effort with us.
I tried to learn the class concept several times from tutorial videos.
This is the first time I really feel I got it right.
Thanks.
Man, I never understood classes and their use until I came across your videos.. They are so easy to understand and you are like the best teacher ever..... Thanks for all your efforts and thank you for these videos.
you have a very firm and clear voice....it pulls my concentration : )
BEST python tutorials on TH-cam by far, hands down! And I'm not being hyperbolic.
I am completely stuck on this specific topic for a Python course I am taking. This is the third video I've watched and I must say that your ability to explain these concepts is awesome. Thank you sir!
Hi Corey,
I noticed a small mistake at 5:46.
When you split the string, you create new strings including the pay variable.
If you were to execute the apply_raise() function on that new_emp_1 variable, the function would try to multiply a float by a string, getting an error.
We need to convert that string to an integer
So that line 34. should read: new_emp_1 = Employee(first, last, int(pay))
Same goes for the subsequent from_string classmethod created using the same way.
Great videos by the way, I am learning tons!
Or better yet, you could always check if the payment is a number in the constructor, as it is one of the uses of a constructor, that way you would always have a number no matter how you instantiated it.
@@d.madureira Hi
Can you please show the code how to checking number in the constructor?
@Daniel Mad please share the code
@@d.madureira Please share the code
@@muzi5366 Looks like self.pay = int(pay)
Better than what our company bought ,licensed materials.
I looked for OOP, design pattern tutorial, but none is as good as yours. !! I started from tutorial 1 and can't stop all the way to Tutorial 3 finished !!! TKS, YOU really rock !
Explained in much more concise detail than several of the paid programming course websites out there. Keep up the good work
I'm a brand new Junior software dev (about 2 weeks in) from a trade background and these are the best videos i have found on OOP even now 7 years later
You are without a doubt whatsoever the best at teaching this that I have ever come across!
still watching your videos in 2024. Fantastic teacher!
How can you be so clear with your explanations no confusions❤
Mr Schafer you are a great teacher, from one teacher to another. I used to teach math in Venezuela but since this comunist regime was installed I don't make enough money for my daily expenses, so at age 67 I am training myself in python programing and in SQL database to see if I can earn some more money as a developer. I got a PhD in mathematics at Louisiana State University in 1995. I'm now totally broke without medical insurance, surviving at expenses of two of my children who lives and worked in the USA.
Hi Corey, you're a great teacher and everything makes sense.. for some reason I came across with your tutorials and it was a blessing.
After 3 videos I am hooked and all shook'd up! - It's like watching a TV series "I’m addicted".
this is seriously hands down best OOP tutorial i have ever seen
OOP is no more remained difficult after watching these. No doubt, lot of hard-work is done for making these master piece tutorials and hard-work always pays.
Man, you are so articulate. The way you express and articulate the concepts is perfect. I write every word you articulate as definitions of my lines of code.
Excellent tutorials. I am new to python but i am getting better watching your videos. Thanks you
Had started classes 6 months back, now here to revise and looks like have forgotten nothing.
The tutorials are explained so smoothly that the person need not to worry about if he will understand the advanced concepts or not. "COREY'S TUTORIALS ARE SHORT BUT EVERY SINGLE LINE IS LIKE GOLD NO ADDED PROMOTIONS JUST KNOWLEDGE AND KNOWLEDGE".
2020 update: this playlist should be preserved
I know this video has been out for a few years, but I wanted to let you know it is still helping new programmers. I was having a problem with some code that I am writing for college homework and this video helped me solve that problem. Thank you for making these great videos.
apply_raise -> self. I like the sound of that!
I have understood more about classes in your first two videos than in my entire time in college....thank you for explaining things so clearly!
Thanks a lot Mr.Schafer. I couldnt understand one bit when my teacher taught the same. Thanks to you, I've got a fair idea about oop.
Thanks! Very clear explanation.
12:44 I found for myself this syntax when you need a quick True/False check:
return True if day.weekday() in {5,6} else False
This was wonderful. Thoroughly enjoyed. I had a lot of confusion about static and class methods and ended up watching many tutorials. None of them was as good as this. You are simply brilliant. Keep up the good work. Thank you so much for the videos. stay blessed.
You are a brilliant teacher - I'm reviewing even introductory classes and getting a whole new deeper understanding of the subjects - Keep it up - you were born to do this!
Very nice explanation. Thank you very much !!!
You seem to anticipate all the questions I have while watching the video. You are a naturally gifted teacher and a credit to the Python community. Thank you so much, sir.
Whe3re do you get your vape juice?
Me: "It's early, let's watch 1 more video from Corey" Ended up with 4 tabs on Chrome and 1 hour of material to watch. Good job there Corey haha.
Corey, thank you for putting links to each part of the series in all of the video descriptions. It saves time and frustration, so I really appreciate that!
I learned a lot from your tutorials and once i get a job as a Py dev, i will contribute for sure. thanks again for great video.
I really can say that after many tries to learn python finally I got many concepts thanks to you. Bravo!
Corey Schafer you are amazing man
big big thank u
i was struggling to learn class from ebooks and some other pdf but luckily found your channel , thanks alot for clearing all initial doubts like instance , self , attribute , methods and all ,
Absolutely superb! The videos on OO are clear, precise and easy to understand. Thanks Corey. I plan on watching (and learning more from) all your videos
you are better than 2 weekends in a row .. thanks man .. u know iv been trying to understand this from different sources and i couldnt really grasp the whole concept ,,,now that im watchin ur videos im so impressed, the lesson is short ,clear and straight to the point, its to sophisticated ,, thanks
I can't believe you've answered every single question that came to my mind while watching this vide. Best OOP explanations ever!
The way you explain everything crystal clear gives me goosebumps.
Man, your pedagogy is excellent. Thank you very much!
ts not imporx or not, no carex nmw, nonex
Best teacher nd person with super skilled , flawless teaching ❤❤ thankyou with each session i get confidence
Must watch python videos. Thanks Corey.
man I am glad I found your channel .. Amazing explanations..I am a Senior in Computer Science this is nothing new for me but the way you explain it is fantastic ...
You've made classes so simple, I wish that i'd watched this series earlier instead of putting off learning about classes
The best explanation so far on the planet. I'm gonna give my best contribution to you for making the best tutorial.
Regular Class automatically pass the instance as the first argument and we call that "Self"
Class Method automatically pass the Class as the first Argument and we call that "CLS"
Static Method don't pass anything automatically and they don't pass instances and or the class
thanks ! good resume.
Thanks for one liner.
@@kannanv8831 3 lines actually :)
Thank you so much. Theses videos are the best in TH-cam for python. It is very clear, has nice voice and no extra nonsense staff. Great staff!
Best Python tutorial ever !
I'm amazed by how easy you make this topic to be understandable for everyone, back in the day i didn't manage to understand what could i do with these, these are top tier explanations, thank you
gaaaaah seriously you are the best teacher. So clear and efficient!!!
Thank you so much for these.
Great tutorials, even without an in-depth knowledge of the language I was able to follow and replicate the work
Hello Corey.. I am a python developer for a close time.. And I have developed many games with pygame, created mini blog, set up sockets and played multiplayer games.. And also deep learning in every section of it.. What I want to say is that.. Untill now, all I could improve after learning classes, was to know the libraries which is also important for me but.. These tutorials are just really enchanced me at the same time I was telling myself what am I missing with python.. I have discovered this channel just 30 mins ago and you are better than anyone I have seen in 5 months.. it is amazing that in the third video you are telling classmethods with a really clear way. This is god level dude. I learned classes coding games.. By teaching myself, because other tutorials were really complicated but this is what I had to see.. i know written a lot, just amazedd
Also sorry for this bad english :D.. keep up you are my new teacher thanks a lot
Hi Corey, you are helping a lot. I just figured out why we would use class method : you could do the same with a static method or even a instance method and write the class name when you need it (like "class_name.method") BUT ! - if you do that and whant to change the class name for "class_name_2" you have to edit your *entire* code to replace it one by one. If you used a class method the "cls" argument will just pass the new name without even noticing something changed. THANKS !
Thanks a lot of these Excellent Videos. Keep the good job
After all these years, i still use your tutorial. thank you again
Very awesome video you have shared
thanks buddy
You are a great teacher. I've got strayed so much using other (and great) online sources because of the questions that popped up in my mind while studying them. Your videos answer most of those questions, because you consider them as part of your curriculum.
And making a great curriculum is the better part of being a teacher.
The conception that "anyone who can do it can also teach it" is so wrong.
My jaw literally dropped when I understood the part when you used the class method as an alternate constructor.
4:25 Class method as alternative constructors
9:10 Real World example with datetime module
10:20 Static Method
Your videos are awesome thanx a lot!
Watching this in 2017... Thanks for getting straight to the point and explaining why each section is useful/important!
I've been doing just hobby Python stuff for the last year, and my only experience was coming from scripting in video games (like pixel bots for Diablo II etc) as a kid.
I can do some really amazing things that quickly turn into 1500+ lines of global functions + if statements and list iterations, but man I would have saved myself a TON of time and confusion over bugs if I had seen your class videos! Great work.
Your class is permanent Mr. Corey. Thanks for summing up in few minutes what many pages of books struggle to! Cheers!
Really ..best one .. :)
I was sent off into a rabbit hole of decorators --> closure --> first-class functions
Coming back to this video feels like completing all your side-quest before defeating the main boss
I wish I had a corey for every other subject of my life...
yes Corey, please make some dating advice videos of this caliber!
Seriously Corey. you are the best. have been through a lot of youtube videos and even udemy course. no one explained things the way you did that too absolutely free. Thank you so much
heh..im on the subway listening to this video...looking forward to goin home and messing around with this..thnx
you are really methodic & you move step by step!! i'm grateful because your videos have sharpenned my skills a lot!!
cheers dear
Thank you very much! Great and comprehensive explanation!
man.. amazing how useful this is even six years after being published, your explanations are great, appreciate it so much. I'm pretty much starting at the beginning w Python, but your careful usage of, and explanation of, terminology and functionality have helped tremendously :)
It's concise and not convoluted, makes me actually WANT to keep learning
ikr!
You are teaching in a way that makes me want to learn more
Don't mind me, just a thankful programmer subscribing twice
I referred to a lot of courses on python on coursera and TH-cam, by no doubt, this one is the best.
These videos are the best in TH-cam.
binge watching this whole series is the best way to spend quarantine. thank you corey for your amazing content!!!
The video was way easier to understand than all the other sources I originally came from, even without watching the other parts of the series. Thank you very much!
Wow Corey, your tutorials are amazing. Please continue doing a lot of them you are doing an awesome job! I always struggled to understand OOP concepts in python even with help from various articles and courses that touched on the subject. Now that changed. Not only do I know how, but also WHY to use which type of method or variable. And it's all packed in short and easy to follow videos and reproducible code
This is the best of the best online. No more googling! I will support your upcoming ones...
Sir, i know you get this a lot, but your tutorials are helping me out so, but so much. You don´t know how much i struggled with the OOP paradigm, and now with your tutorials i´m finally grasping it. As soon as i get some cash in my hands i´l be sure to donate to you, thank you very much sir.
before starting your videos I like them because I don't want to forget to like it!
I'm sure that your tutorials cannot be bad, they are awesome...
You are the best teacher ever! Clear, brief and correct! Like and subscription!
Straight to the point, clear, concise - it's a yes from me.
...I think the caliber of insruction You are offering is just as good as anything U.C.L.A., Standord, & Harvard offer. I"m a Purdue graduate and I'm impressed. Thank You! YES, I subscribed.
i couldn't have found any other better way to this amazing language