Python OOP Tutorial 6: Property Decorators - Getters, Setters, and Deleters

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 981

  • @mariosconstantinou8271
    @mariosconstantinou8271 ปีที่แล้ว +243

    Even after 6 years, this series about OOP is amazing. Thank you Corey

    • @yBazo82
      @yBazo82 ปีที่แล้ว +1

      this helped me so much legit

    • @Poerak
      @Poerak ปีที่แล้ว +1

      Also suprised how accurate and applicable it still is. Really glad I spend the 3 hours learning this.

    • @rijuroy7415
      @rijuroy7415 ปีที่แล้ว

      @@Poerak Really it's amazing.

    • @tejussDotDev
      @tejussDotDev ปีที่แล้ว

      Really still this content taught me a lot

    • @_theashishbhatt
      @_theashishbhatt ปีที่แล้ว

      I agree. I first came across Corey in 2017, was just looking into python at that time but also liked the DIY stuff he did. BTW, @Coreyms with changes in python, has anything become outdated? I was planning to go through the entire playlist.

  • @kevinzhang8974
    @kevinzhang8974 6 ปีที่แล้ว +795

    I watched this whole series (OOP) 3 times and code along with it. I have to say this is so far the best videos I have watched to explain Pyhon OOP. I learned some much from it ... Thanks you!

    • @allinman4028
      @allinman4028 6 ปีที่แล้ว +9

      Same here

    • @masum.rumi7
      @masum.rumi7 5 ปีที่แล้ว +1

      Yup!! Yup!!

    • @TrungNguyen-ld7hz
      @TrungNguyen-ld7hz 5 ปีที่แล้ว +6

      same here, in 2019.

    • @alekhandrosuarez2832
      @alekhandrosuarez2832 4 ปีที่แล้ว +2

      Same here! 2020.
      Thanks Corey! The reason peaple are watching this couple of time is that here you get extremely concentrated and straightforward understanding of OOP itself. Rather then just talking of syntax. The entire series is about an hour lonh, no rubbish, all clear, but there is so many usefull information, that a newbie just can't memorize all of that at once. So I use this series as a handbook.
      Thanks one more time!

    • @alekhandrosuarez2832
      @alekhandrosuarez2832 4 ปีที่แล้ว +2

      BTW for some reason I've been watching from different of my accounts and likes where coming from all of them. :)

  • @petenilson
    @petenilson 8 ปีที่แล้ว +440

    One of the clearest explanations of this that I've seen before. Thanks very much!

    • @copyrightedchannel4939
      @copyrightedchannel4939 3 ปีที่แล้ว

      are you working to google now? 😄

    • @5uperM
      @5uperM 3 ปีที่แล้ว

      For sure.

    • @drygordspellweaver8761
      @drygordspellweaver8761 2 ปีที่แล้ว +4

      5 years ago - wish I had been studying python instead of following the trump election drama

    • @obed818
      @obed818 2 ปีที่แล้ว

      @@copyrightedchannel4939 lol ^^

    • @akhilmachaan5010
      @akhilmachaan5010 2 ปีที่แล้ว

      ​@@copyrightedchannel4939 Can you explain why the email was not updated in the begginning.I didn't understand that part.

  • @ninakoch1799
    @ninakoch1799 4 ปีที่แล้ว +48

    Thank you, thank you, thank you. Spent 13 weeks trying to learn the basics of oop at college, decided to start watching your series 3 days before my test and i think i finally truly understand the concepts, whereas before watching this i was pretty much just copying stuff from my lecture notes and didnt really understand why it did or didnt run properly. Corey, you are an incredibly gifted teacher and i feel blessed to be your student.

    • @Schian
      @Schian ปีที่แล้ว +2

      I know it is a bit of a necro post. How did your test go?

  • @FamilyYoutubeTV-x6d
    @FamilyYoutubeTV-x6d 2 หลายเดือนก่อน +2

    This was beautiful. After months of putting off learning OOP in Python (while focusing on other topics and learning other things, of course), I finally reached a point where I could no longer delay mastering classes and OOP in general. I decided to watch the six videos in this series, coding alongside them in VS Code and using GPT-4 for clarification. In just two days, I managed to learn and clarify a significant amount of information and concepts that I had been avoiding. It turned out to be much simpler than it initially seemed. However, the terminology - like initiator, constructor, class, instance, attribute, method, class method, class variable, decorator, special methods, and even the syntax (e.g., property decorators) - made everything confusing. Every video and explanation I came across over the past months used these terms so freely, as if I was expected to know them already. Fortunately, TH-cam recommended the right tutorial series at just the right moment, and I took advantage of that motivation to dive in. I don’t regret it at all. Thanks a lot - this is invaluable for my career.

  • @Skaxarrat
    @Skaxarrat 6 ปีที่แล้ว +669

    Holy shit, in a bit of an hour I've understood concepts that would take hours to understand and fix the information in my brain. Thanks Corey
    P.D: You need to write a Python book

  • @eduardotarikfernandes6051
    @eduardotarikfernandes6051 4 หลายเดือนก่อน

    Just finish to watch the playlist, very good! Thanks Corey

    • @coreyms
      @coreyms  4 หลายเดือนก่อน

      Thank you! Glad you found it helpful!

  • @remzgr
    @remzgr 4 ปีที่แล้ว +15

    I am a non-programmer trying to learn Python and this series has been an absolute boon when compared to the other courses! Thankyou very much Corey!

    • @deadbod4
      @deadbod4 4 ปีที่แล้ว

      I second this

    • @akhilmachaan5010
      @akhilmachaan5010 2 ปีที่แล้ว

      @@deadbod4 Can you explain why the email was not updated in the begginning.

    • @deadbod4
      @deadbod4 2 ปีที่แล้ว

      @@akhilmachaan5010 i cant, i quit learning python and went full crypto

    • @jiakai7254
      @jiakai7254 ปีที่แล้ว

      @Akhil Machaan the email is an attribute that got initialized with the old first_name and last_name.
      To change the email, you would need to create a method that accesses the first and last names, but then all the existing code will have to be changed to access email like a method.
      the getter allowed us to define a method for email that can be accessed like an attribute so there's no need to change the existing code.

  • @dhananjay4525
    @dhananjay4525 ปีที่แล้ว +1

    Bhaiya, bahut bahut dhanyawaad.....One of the best explanations on getters and setters in python across youtube

  • @allinman4028
    @allinman4028 6 ปีที่แล้ว +35

    I had no coding experience. I followed beginner series and OOP series and coded along with them with my little three kingdoms game concept. I feel I built great a solid fundamental understanding of Python. It will be extremely useful for my future coding journey. Thank you so much, Corey.

  • @zihanchen4312
    @zihanchen4312 4 ปีที่แล้ว +2

    If there is a Competition on the Internet to choose which is the best channel for Python Programming, I would vote for this channel with no hesitation. Huge Respect!

  • @colinmanko7002
    @colinmanko7002 6 ปีที่แล้ว +23

    Perfectly paced. Watched all 6 parts of ‘Working with Classes’ without needing to pause. Corey goes over concepts in a logical order and without fluff (as a good programmer would). I’ll be back!

  • @hichamamchtkou7343
    @hichamamchtkou7343 4 ปีที่แล้ว +1

    Men, they should give you like a nobel prize about what you have done not only in this tutorial but in your TH-cam channel , you're like superman for Python developers, thank you very much!

  • @danpickford3894
    @danpickford3894 4 ปีที่แล้ว +866

    If i can learn OOP at 2am in quarantine without the use of my singular brain cell then the explanation must be doing something right XD

    • @Hsa008
      @Hsa008 4 ปีที่แล้ว +7

      😄😂😂😁😀😅😅😆😆😆😉

    • @srikarrepaka5023
      @srikarrepaka5023 4 ปีที่แล้ว +13

      I am learning it at 4:50 am 😇😂😂

    • @danpickford3894
      @danpickford3894 4 ปีที่แล้ว +14

      @@srikarrepaka5023 where you at my guy cos now i'm tryna learn a* at 2:10 am , us guys have no lives do we?
      edit: I just realised that I seem obsessed with coding at 2am, I have MANY problems and... apparently 2am is one of them...

    • @wave8889
      @wave8889 4 ปีที่แล้ว +9

      I lean at 0:30 am and tomorrow is the exam xD

    • @easyscience2235
      @easyscience2235 4 ปีที่แล้ว +4

      Exactly what I am doing right now, when the mind is clear xD

  • @esthers5201
    @esthers5201 ปีที่แล้ว

    I went through about 5 videos trying to understand why we need property decorators....your video was the only one that explained it in a clear and concise manner!!

  • @imranayari
    @imranayari 4 ปีที่แล้ว +7

    After weeks of learning of OOP in python using other sources and I couldnt understand, now in 60 minutes plus, I was able to understand the concepts and logics behind OOP. Thanks Corey Schafer

  • @FaberLSH
    @FaberLSH 5 หลายเดือนก่อน +1

    The best series ever!! I never learned so much about class as I'm learning here today in 2024!

    • @la-dev
      @la-dev 4 หลายเดือนก่อน

      We are late to the party, but food is still fresh.

  • @CalvinJKu
    @CalvinJKu 6 ปีที่แล้ว +20

    Best python channel ever. This decorator thing has troubled me for so long!

  • @bsmaheshkumar5328
    @bsmaheshkumar5328 2 ปีที่แล้ว +1

    His quality of explaining is next level, Thanks, buddy.

  • @aidensmith6277
    @aidensmith6277 6 ปีที่แล้ว +3

    Other tutorials are so... bleh they just make you feel confused on the spot. Others make you feel like you understand because they don't tell you the whole story. You, sir, are neither. You are an awesome teacher. Thanks! 😅

  • @SantoshkumarPandeySKCP
    @SantoshkumarPandeySKCP 5 หลายเดือนก่อน +2

    You made it seem so easy to understand throughout this OOP playlist. Thank you.

  • @nimaliberty4734
    @nimaliberty4734 6 ปีที่แล้ว +3

    Hi there Corey, YOU are a GENIUS. your VIDEOS are the BEST on youtube. I wanted to give up till I came across your videos. You are a life saver. A big THANKS to a HERO THAT YOU ARE.

  • @sreekanththota2200
    @sreekanththota2200 4 ปีที่แล้ว +1

    I just now compleated all ur OOP concepts,it took 2days for me......finally feeling happy......Tqs for osm explanation.....

  • @alexisaddicted
    @alexisaddicted 4 ปีที่แล้ว +10

    Unbelievable quality of this content, well done! Simple yet concise and to the point. Helped me a ton, thanks!

  • @Pramesh37
    @Pramesh37 ปีที่แล้ว +2

    You're a life saver. Although I knew OOPS, I wanted to brush up to get my concepts clear. You explained concepts in such a way that I don't need to brush up on OOPS ever again! Thanks a ton.

  • @slimyelow
    @slimyelow 5 ปีที่แล้ว +18

    Took me all morning coding and documenting along, but finally got my grip on this. Yay Corey !

  • @christophermichaelrytting5465
    @christophermichaelrytting5465 5 ปีที่แล้ว +2

    Property decorators are not that hard to explain, and you seem to be the only person on the internet who realizes that! Thanks much.

  • @dilpreetsinghnagra
    @dilpreetsinghnagra 4 ปีที่แล้ว +5

    I have watched his almost every video related to python and believe me he explained to me clearly every concept that I wanted to study related to python

  • @milindsabnishd
    @milindsabnishd ปีที่แล้ว +2

    I couldn't understand 'Decorators' concept anywhere, but you made it so simple. Thanks a ton, Corey Sir.

  • @shivajishinde1496
    @shivajishinde1496 5 ปีที่แล้ว +3

    The best python teacher I ever had. Thank so much for providing highly valuable information. I like your accent very much!!

  • @marcc1179
    @marcc1179 4 ปีที่แล้ว

    I was watching another video explaining the property decorator. However, he used so complicated an example that I did not grasp the idea. Yours is easy to understand. Well done! Best python teacher on youtube!

  • @JonathanHobbe
    @JonathanHobbe 6 ปีที่แล้ว +9

    Finally someone that explains it so you understand the logic behind it! Thanks so much!

  • @blossoms2u
    @blossoms2u 2 หลายเดือนก่อน

    This is by far the best python class i ever saw

  • @nissan5563
    @nissan5563 3 ปีที่แล้ว +4

    I already watched your multiple videos including this OOP series and there is no doubt that I enjoyed it so much. Most appreciating point for me that, your neat and clean explanation without repeating or adding any unnecessary words. Please continue with more videos

  • @kavabangaungava
    @kavabangaungava 6 ปีที่แล้ว +4

    This is a brilliant example of how to explain complex things in simple language!

  • @AhmedKhan-yw3wx
    @AhmedKhan-yw3wx ปีที่แล้ว +1

    I finally learned what property decorators are, thank you Corey!

  • @daevski
    @daevski 5 ปีที่แล้ว +6

    Bro, this is genius; I understood this example very clearly, and I was struggling to understand @property otherwise. Thanks so much for this awesome example!

  • @ДмитрийКовалевский-ш5ф
    @ДмитрийКовалевский-ш5ф 3 ปีที่แล้ว

    Блин, круто объясняет! Из всего что он говорит, понимаю процентов 20, но всё понятно. Без воды, быстро, всё по теме! Спасибо!

  • @venkysmoments9155
    @venkysmoments9155 6 ปีที่แล้ว +5

    Your way of explaining and breaking things into smaller and understandable way is awesome. You are an great tutor.Learned lot of stuffs from your tutorials. My longtime wish from me is please make videos regarding Multithreading and MultiProcessing. So that all of us can make utilize and learn these concepts in a simplified manner.

  • @Mainhunpyarkamusafir
    @Mainhunpyarkamusafir 5 ปีที่แล้ว +3

    Can't believe This channel was there and I found it now ... Awesome Corey .. I never understood these concepts before :)

  • @jakebirkmaier5703
    @jakebirkmaier5703 ปีที่แล้ว

    I've been using a python OOP API for maybe a year on and off (thousands of lines/hundreds of hours) and never truly understood classes because I couldn't find a video series that explained them this well.
    This playlist has been so excellent for me and I appreciate you putting it together!

  • @tivasalvation
    @tivasalvation 4 ปีที่แล้ว +8

    This is good! I actually just came here to learn the OOP. I just found myself going through the whole channel. The lectures are great 👌

    • @gravnine
      @gravnine 3 ปีที่แล้ว +1

      Same here!

  • @saurabhkansal8178
    @saurabhkansal8178 8 ปีที่แล้ว

    Before starting these videos, I don't have any knowledge of classes. But now i got the concept and can understand the source codes in better way. Thanks Corey... Thanks a lot..

  • @mrshyam538
    @mrshyam538 5 ปีที่แล้ว +4

    You are a great teacher... I have been following through all your playlists and i have learned a lot in so little time.
    Thank you so much whole heartily

  • @AmroKhalil-xo9tu
    @AmroKhalil-xo9tu 7 หลายเดือนก่อน

    It has been at least year since I have given up on OOP! This was exactly what I needed for such a long time.

  • @franklinbradfield9131
    @franklinbradfield9131 7 ปีที่แล้ว +5

    So much more useful than the Python docs that use "foo", "bar", and "x" for everything!

    • @zes7215
      @zes7215 6 ปีที่แล้ว

      no such thing as need

  • @Tadae323
    @Tadae323 8 ปีที่แล้ว +1

    Seriously, checked the whole Internet and your tutorials are the best.

  • @meenumeric
    @meenumeric 6 ปีที่แล้ว +3

    I first press like button before watching your videos. Awesome work!

  • @tanselervansel1648
    @tanselervansel1648 4 ปีที่แล้ว +1

    The Best Teacher in Phyton so far. Thanks for your education.

  • @mujahidrasheed4987
    @mujahidrasheed4987 8 ปีที่แล้ว +30

    Great post..
    For PYthon 2: the Class must inherit from the 'object' class to able able to use decorators.
    example: class Employee(object)
    learnt it the hard way..

    • @mujahidrasheed4987
      @mujahidrasheed4987 8 ปีที่แล้ว +1

      Wanted to ask,, are there more vids coming up on OOP or this was it?? Thanks COrey

    • @coreyms
      @coreyms  8 ปีที่แล้ว +28

      Hi Mujahid. These 6 videos were the ones I really wanted to get done. Now that they are finished I am focusing on some different video. I do think I'm going to add to this series later on, but have no immediate videos in the works. I did want to finish some videos on Multiple Inheritance and Abstract Base Classes, so when I do those videos, I will likely add them to this series. Thanks

    • @zorkan111
      @zorkan111 8 ปีที่แล้ว +1

      Mujahid, thanks for the tip. I'm using Python 2 and I was wondering why my code didn't work the way it did on the video.
      Any explanation as to why the class has to inherit from 'object'?

    • @indirajithv5041
      @indirajithv5041 7 ปีที่แล้ว

      Just read this comment. Looking forward to learning from coming tutorials! Thank you very much.

    • @susannaventafridda430
      @susannaventafridda430 6 ปีที่แล้ว

      Hey Mujahid, I am also using Python 2 and when I try
      emp_1.fullname="Corey Schafer" (min. 6:40 and line 25 in the video)
      it gives me this error: TypeError: 'str' object is not callable.
      I have, like you, written class Employee(object):...
      but I really can't solve this problem. How did you do it?
      Thanks!

  • @gevillgar
    @gevillgar 3 ปีที่แล้ว +1

    Your explanation is like a very optimized code. It serves its purpose with the minimum amount of examples and words needed to make the concept clear.

  • @saitaro
    @saitaro 7 ปีที่แล้ว +92

    Glad I found your channel...

  • @noyou9349
    @noyou9349 ปีที่แล้ว

    Honestly, this series is the best I've ever seen on OOp. It's concise, clear, and the explanations are good. I'll say it again, I wish I had found this series when I was learning OOP. Good job

  • @matitiudeforever8155
    @matitiudeforever8155 6 ปีที่แล้ว +8

    thank you for all of your lectures !! may god bless you and you find happiness in your life

  • @kristiantorres1080
    @kristiantorres1080 3 ปีที่แล้ว

    Best explanation of property decorators on youtube hands down!

  • @LadyPary8
    @LadyPary8 4 ปีที่แล้ว +4

    I love how you explain everything so simple and clear! I watched this whole tutorial! Thank you so much! Be safe.❤️
    Ps. Your really good voice makes this learning process a lot better and easier :)

    • @coreyms
      @coreyms  4 ปีที่แล้ว +1

      Thanks!

  • @pranayteja8330
    @pranayteja8330 2 ปีที่แล้ว

    Hands down the best Python OOP tutorial!

  • @czagazeta
    @czagazeta 5 ปีที่แล้ว +3

    Thank you for this series! Your series cleared up a lot of the confusion I had about OOP in Python. I sent some BTC, and likes your way. Cheers!

  • @ordinaryBrain4300
    @ordinaryBrain4300 6 หลายเดือนก่อน +1

    I am in disbelief that I came here because my paid course confused me. This tutorial is far better. Thanks a tonne! ❤

  • @imranayari
    @imranayari 4 ปีที่แล้ว +55

    You can as well password protect the changes that can be applied to the property decorator, for instance, on deleter implementation:
    @fullname.deleter
    def fullname(self):
    password = input('Please enter password: ')
    if password == 'pass':
    print('The fullname ' +self.first +' ' +self.last +' is deleted')
    self.first = None
    self.last = None
    else:
    print('Invalid password')

    • @MODDINGPRIME
      @MODDINGPRIME 4 ปีที่แล้ว +1

      Very useful! Thanks for this :D

    • @DragonRazor9283
      @DragonRazor9283 3 ปีที่แล้ว +2

      Is there a smart way to obscure the "if password == 'pass'" statement so that others won't just look at the source code that easily?

    • @eldadizhaky
      @eldadizhaky 3 ปีที่แล้ว +8

      @@DragonRazor9283 You can use a hash function on your password, and when the user inputs a password, use the same function and compare the hashes.

    • @wildmanofhk
      @wildmanofhk 3 ปีที่แล้ว

      Good stuff

    • @vanchark
      @vanchark 2 ปีที่แล้ว +1

      @@DragonRazor9283 You can use the bcrypt python module for that. Example:
      import bcrypt # pip install bcrypt
      pw = "test_password"
      salt = becrypt.gensalt() # salt is a random value that gets added to every hash to ensure it's unique
      hashed_pw = bcrypt.hashpw(pw, salt) # generate hash
      if bcrypt.checkpw(pw, hashed_pw): # compare hashes
      # success --> do something
      else:
      print("invalid password")

  • @hermesdhenares6893
    @hermesdhenares6893 4 ปีที่แล้ว

    I made a Python course some months ago: paid too much for too little; I began the Treehouse Python Track: too many conceptual holes, some topics barely explained. You just filled each and every one of those holes, Corey. Your vids are fantastic!

  • @Jaybearno
    @Jaybearno 6 ปีที่แล้ว +4

    Best python videos ive found, keep em coming. Im coming from an analyst background so am more used to performing examples like these with database operations. Can anyone pls describe other common use cases for attribute setting?

  • @abdelqadir5227
    @abdelqadir5227 ปีที่แล้ว

    Coming back to remind myself of python after a long break from coding. Very useful videos. Thanks

  • @dr_920
    @dr_920 5 ปีที่แล้ว +3

    Thank you so much for spending time on preparing the Class series. I've learned a ton from them.

  • @adetolasanni007
    @adetolasanni007 2 ปีที่แล้ว

    I just finished your playlist. Before now I was totally confused of OOP but watching this video gives me a fresh start. Thank you.

  • @soumitripattnaik
    @soumitripattnaik 7 ปีที่แล้ว +55

    At 5:54 can't we simply do self.first, self.last = name.split(' ')
    ??
    It's been a great learning experience from your videos :)

    • @coreyms
      @coreyms  7 ปีที่แล้ว +39

      Yes

    • @h82fail
      @h82fail 6 ปีที่แล้ว +6

      Was thinking the same thing and was getting ready to type it out to test myself, good to know it will work.

    • @karthik-ex4dm
      @karthik-ex4dm 6 ปีที่แล้ว +2

      Good one!

    • @kamranshirazi3030
      @kamranshirazi3030 2 ปีที่แล้ว

      Sure, good observation. But as a teaching method, I think, it was more artistic to have a uniform format as the class's __init__ the way he did it, that is also better for people who are learning it.

  • @hasanshami8371
    @hasanshami8371 3 ปีที่แล้ว +1

    I failed to fully comprehend a lot of these in university. I don't know what kind of mojo you're using but this explanation is brilliant.

  • @PavansnSMG
    @PavansnSMG 7 ปีที่แล้ว +4

    Impressive. I just love these videos. They made Python even more interesting. Thanks Corey. Keeping making videos like this and help novice programmers like me :P

  • @colorbars8564
    @colorbars8564 3 ปีที่แล้ว

    awesome videos, still being watched 5 years later. Thanks for the great content

  • @domillima
    @domillima 2 ปีที่แล้ว

    Corey, this is excellent. Sorry to unearth a 6 year old post. But truly your series is one of the best I've found in 2022.
    I understand adding the @property decorator will allow you to access your method as an attribute. If I'm following along: in this case you wanted to do this because you previously defined a self.email attribute (i.e. print(self. First + '.' + self. last + '@email.com'), but this is static as an attribute whereas it will update itself as a method. So creating a method and using @property allowed for the emails to update as the names updated, while the rest of your code remaining unchanged and referring to self.email as an attribute.

    • @domillima
      @domillima 2 ปีที่แล้ว

      Now, I kinda lost you with the full name examples. What is the benefit of using the property decorator with fullname. And then you used @fullname.setter. Why not just keep fullname setter as a method:
      def full_name(self, full_name):
      print('This is a setter method')
      first, last = full_name.split(' ')
      self.first = first
      self.last = last
      such that you could just type the full name into parenthesis
      employee1.fullname('John Smith')
      Whats the difference/benefit here?
      Thanks!

  • @NaachoElegante
    @NaachoElegante 5 ปีที่แล้ว +3

    really appreciate your skills and talent of explaining...............loved everything about your videos...........be it voice, language, content, explanation, concept...........too good..............would request you to make some videos on data structures with python

  • @MariaHanulova-v2n
    @MariaHanulova-v2n ปีที่แล้ว

    Thank you very much, these are the best Python learning videos I have seen so far.

  • @iremkaya9103
    @iremkaya9103 7 ปีที่แล้ว +3

    Why haven't I found you sooner, I would have done a lot better in lab classes of Python :(( You are great!

  • @kinmokuseikaori11
    @kinmokuseikaori11 2 ปีที่แล้ว

    This is a billion times better than anything I have seen thus far. Simply amazing!

  • @TonyFlexPromo
    @TonyFlexPromo 6 ปีที่แล้ว +5

    This one is actually blowed my mind. Thank you for this tutorials!

  • @dileepbc5901
    @dileepbc5901 3 ปีที่แล้ว +1

    thank you Mr Schafer for the tutorial i watched the whole series of OOP. next ill practice more

  • @need2game834
    @need2game834 5 ปีที่แล้ว +5

    I like how the first video has over 1 million views and the last one 226k :D for me I watched the whole series and it was excellent, thanks Corey

  • @ArjunKG95
    @ArjunKG95 6 ปีที่แล้ว +2

    I've read about @property in so many places. But understood it properly for the first time here. Amazing video!

    • @Nuhyamin1
      @Nuhyamin1 6 ปีที่แล้ว

      I still don't understand it, help me please

  • @ManishKumar-hv8hg
    @ManishKumar-hv8hg 4 ปีที่แล้ว +9

    Please sir, like this, make a tutorial on "Data Structures using python" like; linked list, stack, queue, tree and graph

  • @slimanemesbah7003
    @slimanemesbah7003 2 ปีที่แล้ว

    i like the way you explain by needs, like " we do this, because later on you gonna find an error" also i like the way you compare it to java, thanks corey

  • @swadhikarc7858
    @swadhikarc7858 8 ปีที่แล้ว +17

    Hi Corey,
    Your videos are none other than best! Simple and easy to understand. I am a beginner to Python and have a question in deleter. The example you have shown is used to delete a property. Can you explain how to delete an instance itself? example: del emp_1?
    Thanks a lot for your videos!

    • @coreyms
      @coreyms  8 ปีที่แล้ว +12

      Hey there. If you wanted to delete the instance and completely remove the binding of emp_1 from the namespace, then yes, you could just say:
      del emp_1

    • @dragost8670
      @dragost8670 6 ปีที่แล้ว +1

      Hi, Corey. Just tried to use del for an instance but the second one was deleted either. Here is the code:
      class Robot:
      def __init__(self, name):
      self.name = name
      def say_hi(self):
      print('The robot ', self.name, ' says hello!' )
      def __del__ (self):
      print('The robot ', self.name, ' was destroyed! :((')
      if __name__ == '__main__':
      x = Robot(input('the name of the first robot, please:'))
      y = Robot(input('the name of the second robot, please:'))
      for i in [x, y]:
      i.say_hi()
      print('deleting first robot')
      del x
      print("we'll not destroy any robot anymore! :)")
      y.say_hi()
      # after running this code, y instance is also deleted. I really don't understand why... Kindly please help on this. Thanks in advance!

    • @PiddBoo
      @PiddBoo 6 ปีที่แล้ว +1

      Your question is already 3 months old, therefore i don't know if this is helpful to you: but your code works just fine. I had to change the "if _name_ == '__main__'" to "if __name__ == '__main__'" because it was causing a name error. But other than that the output is as expected.

    • @riturajsminivlogs
      @riturajsminivlogs 6 ปีที่แล้ว

      if True:
      x = Robot(input('the name of the first robot, please:'))
      y = Robot(input('the name of the second robot, please:'))
      for i in [x, y]:
      i.say_hi()
      print('deleting first robot')
      del x
      break
      print("we'll not destroy any robot anymore! :)")
      y.say_hi()

  • @iribaaa2643
    @iribaaa2643 3 ปีที่แล้ว

    No way! This series was literally Awesome! Thank you man. Thank you...

  • @johnhendy1281
    @johnhendy1281 7 ปีที่แล้ว +14

    This has been an amazing series! I've taken some Coursera classes, but always felt overwhelmed when I saw classes and the dreaded __foo__ and `self` stuff start showing up. Thanks so much for making these!
    One question... is there a reason not to do: `self.first, self.last = name.split(' ')` when you define the fullname.setter? Perhaps expanding is more readable?
    Quick edit: I did this, and it seems to work fine. I mainly wondered if it's considered more pythonic to do one vs. the other.

    • @powerblender
      @powerblender 7 ปีที่แล้ว

      I think you can do that.. but using self.first = first and self.last = last makes the code more readable, I think.

    • @silverzero9524
      @silverzero9524 7 ปีที่แล้ว

      maybe he forgot lol

    • @sbarter
      @sbarter 7 ปีที่แล้ว

      self.first, self.last = name.split(' ') creates a list. i'm guessing here but it probably slows down the code.

    • @darkaero
      @darkaero 7 ปีที่แล้ว +1

      I think he did it that way to be able to explain step by step what was going on when you're using the split() to separate the full name and how using the self.first and self.last gets it to work again.

    • @manishbagra9494
      @manishbagra9494 6 ปีที่แล้ว

      he did it to make it more clear but you can also do like " self.first, self.last = name.split(' ') "

  • @byheartgeeta
    @byheartgeeta 3 ปีที่แล้ว

    I finished this in a single sitting along with the practice. I can't explain how precious this content is. more power to you @Corey. so much love from India.

  • @johntank3004
    @johntank3004 4 ปีที่แล้ว +9

    This would a good example how to deal with someone switching their last name because of marriage or someone having a full name change.

  • @sureshroyala6296
    @sureshroyala6296 7 ปีที่แล้ว

    Very structured and easy to follow. I managed to complete the series in less than a day. Now off to get my hands dirty. Thanks a ton for this.

  • @Pkmafffy
    @Pkmafffy 7 ปีที่แล้ว +9

    Amazing series on OOP - I learnt so much!
    One thing I don't quite understand is when to leave your attributes as public or using '_' (underscore) notation to privatise them. When playing around with the underscore notation I sometimes get 'maximum recursion errors'. I know this isn't covered in this series, but I would really appreciate it if you knew of any resources to better understand this.
    Thanks

    • @kaushaltak007
      @kaushaltak007 5 ปีที่แล้ว

      Maybe it's late but you can check this link out www.python-course.eu/python3_class_and_instance_attributes.php

  • @PythonKali
    @PythonKali 10 หลายเดือนก่อน

    i watched the whole series and thank you so much. You recorded this 7 years ago and still soo good soo understandable, finally all questions and blurs in my mind are gone.

  • @sundaymanali5854
    @sundaymanali5854 3 ปีที่แล้ว

    Great series watched twice. Just listened for the first time. second time tried to code em in first. thank you a lot mate

  • @manulgoyal6662
    @manulgoyal6662 5 ปีที่แล้ว +339

    30 semicolons disliked the video

  • @Aerish369
    @Aerish369 ปีที่แล้ว

    The best playlist to learn OOP in Python. Thank you Corey

  • @Mrjarnould
    @Mrjarnould 8 ปีที่แล้ว +3

    Great video!

  • @KOtwenyo
    @KOtwenyo 7 ปีที่แล้ว +1

    I must say, I am learning from you more than I did from an MOOC that teaches the same Python, thank you Corey

  • @anon-sl4vp
    @anon-sl4vp 6 ปีที่แล้ว +3

    print('Love learning with Corey Schafer xD')

  • @arindamghosh4555
    @arindamghosh4555 2 ปีที่แล้ว

    Thanks a ton .Finally got to learn OOP in python after watching these videos a couple of times

  • @timo_b3
    @timo_b3 3 ปีที่แล้ว +1

    I watched many other videos about this topic, but this series is by far the best one to learn oop python. thank you corey!

  • @seifbouanik3689
    @seifbouanik3689 4 ปีที่แล้ว +1

    No jabber, straight to the point, great job!

  • @fresnohotdog
    @fresnohotdog 10 หลายเดือนก่อน

    way clearer than what i got at college, thank you!

  • @riteshkarmakar3597
    @riteshkarmakar3597 10 หลายเดือนก่อน

    Completed the entire series. It was really great. Thank you very much!

  • @Given_A
    @Given_A 11 หลายเดือนก่อน +2

    Watching in 2024 and still learnt alot.
    Thanks Mr Corey!