
Object Oriented Programming with Python - Full Course for Beginners
video description
Date: 2022-03-14
Related videos
Comments and reviews: 10
PK
I am actually an intermediate programmer but I was working on a web scraping project in which I did not need classes, so after 4 months I kinda forgot advanced OOP in python and I wish this tutorial would have been made when I was learning OOP. After taking this course I realized that a lot of OOP concepts of mine were not clear before. A lot of professors cant even explain -self- and this guys just did in 13 minutes of the start of this video. I have no idea why something with so simple meaning is considered to be the most complex topic in OOP python? They should have just said that self is basically the object passing itself as a parameter inside a function, so we can call those methods through different objects of the same class. or just make a method inside any class and in the method type -print(type(self)) and then call that method through an object of that class. you will see the output as a class '__main__.name of the class'. you can also do print(type(item_1)) and the output will be the same. sp self is just a reference to the class telling python that this function inside the class belong to the class.
reply
I am actually an intermediate programmer but I was working on a web scraping project in which I did not need classes, so after 4 months I kinda forgot advanced OOP in python and I wish this tutorial would have been made when I was learning OOP. After taking this course I realized that a lot of OOP concepts of mine were not clear before. A lot of professors cant even explain -self- and this guys just did in 13 minutes of the start of this video. I have no idea why something with so simple meaning is considered to be the most complex topic in OOP python? They should have just said that self is basically the object passing itself as a parameter inside a function, so we can call those methods through different objects of the same class. or just make a method inside any class and in the method type -print(type(self)) and then call that method through an object of that class. you will see the output as a class '__main__.name of the class'. you can also do print(type(item_1)) and the output will be the same. sp self is just a reference to the class telling python that this function inside the class belong to the class.
reply
Jan
Hello, thanks for amazing tutorial, you helped me so much!!
I just wanted to ask you about the getters and setters: I tried to change the code so that I commented the getters and setters methods and instead I used the assert function to give me an error if I pass name that is too long. The effect was exactly the same as if I worked with the methods (getters and setters). So what is the point of using the setter if you first disallow the user to change the inserted value, but then you just cancel it by assigning the setter method (afterwards they could change the name, same as if there were not any getters and setters).
Thank you for response!
reply
Hello, thanks for amazing tutorial, you helped me so much!!
I just wanted to ask you about the getters and setters: I tried to change the code so that I commented the getters and setters methods and instead I used the assert function to give me an error if I pass name that is too long. The effect was exactly the same as if I worked with the methods (getters and setters). So what is the point of using the setter if you first disallow the user to change the inserted value, but then you just cancel it by assigning the setter method (afterwards they could change the name, same as if there were not any getters and setters).
Thank you for response!
reply
Vedran
You really should learn Pythonic way of writing object-oriented programs, not try to shoehorn Python into notions of how some other languages do OOP. Watch Hettinger's Class Development Toolkit and learn it sometime.
Analogy: imagine someone coming to C++ after Python, and declaring every method virtual, and declaring everything a friend of everything else, just because it reminds them of how Python does things. Horrible, right? That's how _you_ look to me when you're misusing properties, name mangling and local scopes. Different programming languages model different ideas, they aren't just different words for the same concepts.
reply
You really should learn Pythonic way of writing object-oriented programs, not try to shoehorn Python into notions of how some other languages do OOP. Watch Hettinger's Class Development Toolkit and learn it sometime.
Analogy: imagine someone coming to C++ after Python, and declaring every method virtual, and declaring everything a friend of everything else, just because it reminds them of how Python does things. Horrible, right? That's how _you_ look to me when you're misusing properties, name mangling and local scopes. Different programming languages model different ideas, they aren't just different words for the same concepts.
reply
Travel
[27:00- I defined self as -def __init__(self, name: str, price: float, quantity = 0) -> None:- and tried with the object as -item1 = Item(34, -hello-, 5)- and thought it will give an error. But it worked with output as -total price 1: hellohellohellohellohello- for print(f-total price 1: -item1.calculate_total_price()--). I am using Python 3.9.7. Is there any change in newer Python version as this is working with out error (not kinda checking the variable type explicitly )?
reply
[27:00- I defined self as -def __init__(self, name: str, price: float, quantity = 0) -> None:- and tried with the object as -item1 = Item(34, -hello-, 5)- and thought it will give an error. But it worked with output as -total price 1: hellohellohellohellohello- for print(f-total price 1: -item1.calculate_total_price()--). I am using Python 3.9.7. Is there any change in newer Python version as this is working with out error (not kinda checking the variable type explicitly )?
reply
theMuritz
That was a great Tutorial many thanks for that. It-s not only the 10 Min parent, child Blabla - Jim is actually guiding us step by step even letting us experience Pitfalls, resulting error messages and explaining how to remedy them.
reply
That was a great Tutorial many thanks for that. It-s not only the 10 Min parent, child Blabla - Jim is actually guiding us step by step even letting us experience Pitfalls, resulting error messages and explaining how to remedy them.
reply
Ernesto
after instantiating objects from the csv file how do you run the methods on those objects? since they're not associated to item1, item2, etc , i don't understand how to run the methods on them. -JimShapedCoding
reply
after instantiating objects from the csv file how do you run the methods on those objects? since they're not associated to item1, item2, etc , i don't understand how to run the methods on them. -JimShapedCoding
reply
PK
Now i am in this video for 50 minutes and I got to say, this video is golden. This video is like if you want to digest 1000 pages of content in one video. Truly Awesome.
reply
Now i am in this video for 50 minutes and I got to say, this video is golden. This video is like if you want to digest 1000 pages of content in one video. Truly Awesome.
reply
indometalpython
-1:44:20 I thought the point of a read-only attribute was to not be able to change its value so then, why are we using setter to bypass that feature?
reply
-1:44:20 I thought the point of a read-only attribute was to not be able to change its value so then, why are we using setter to bypass that feature?
reply
indometalpython
ABSOLUTELY FANTASTIC!!! Thank you so much Jim. I followed this tutorial line by line and learnt so much. I owe you this new beginning of my life.
reply
ABSOLUTELY FANTASTIC!!! Thank you so much Jim. I followed this tutorial line by line and learnt so much. I owe you this new beginning of my life.
reply
invinceble
could anyone please explain further the -return num.is_integer()- part at 1:07:10 ? How does it check for the point zero of a float?
reply
could anyone please explain further the -return num.is_integer()- part at 1:07:10 ? How does it check for the point zero of a float?
reply
Add a review, comment















