Python Tutorials - Property Decorators Part 1

Поделиться
HTML-код
  • Опубликовано: 18 фев 2019
  • In this Python programming video tutorial we will learn about the property decorator in detail.
    Property decorator is a built in decorator which allow us to use class method as attributes. The main purpose of any decorator is to change your class methods or attributes in such a way so that the user of your class no need to make any change in their code. property decorator serve this purpose.
    Decorators All videos:
    • Python Decorators | Tu...
    #PythonProgramming #Decorators #@property
    For more free tutorials on computer programming
    / amulsacademy
    / amulsacademy
    Instagram Id:
    Amuls Academy

Комментарии • 45

  • @zameerahmed1775
    @zameerahmed1775 4 года назад +9

    You sound young but ur understanding is awesome. All this is commercialised but you are just giving it away. I'am thankful & grateful to you & I would pray for ur long life.

  • @summayyahashmani2494
    @summayyahashmani2494 3 года назад +7

    Hello ma'am. You made my interview easy! I brought a python course on udemy, and didn't learn anything. But this playlist is just awesome! It's worth is much more! Thank you so much❤️

  • @thangtran145
    @thangtran145 2 года назад +1

    Many thanks! Clearly explained, I felt a great relief when I could understand this topic with your instruction. Absolutely a great feeling.

  • @panagiotisgoulas8539
    @panagiotisgoulas8539 3 года назад +4

    That was so helpful, thank you so much for clearing this mess up. Especially last 2 minutes where I was confused.

  • @gershondevadason4656
    @gershondevadason4656 2 года назад

    Clear and comprehensive explanation!

  • @proshro
    @proshro Год назад

    I saw so many videos on this, Everybody using the same things to explain, Thank you so much for this explanation, I saw part 2 as well, now concept clear.

  • @newhotmansun
    @newhotmansun 4 года назад +1

    I am a leaner from China.This "property" has confused me for a long time.Thank you for making it so clear. It helps me so much.

    • @kumarniloy1798
      @kumarniloy1798 3 года назад

      Those people who lived in china can use utube

  • @sarojbudhathoki8786
    @sarojbudhathoki8786 4 года назад +2

    thank you for this video, first i got some confusion but later i got it clearly than ever. Thanks again

  • @zameerahmed1775
    @zameerahmed1775 4 года назад +3

    Awesome sister .... Keep it up.

  • @sairamnagarajan8289
    @sairamnagarajan8289 5 лет назад +3

    Thanks for your effort. Neat and crisp explanation

  • @syedismail1954
    @syedismail1954 5 лет назад +2

    U r voice so nice and ur way of explanation so good...keep doing new tasks video's...

  • @DaniruDEV
    @DaniruDEV 3 года назад +2

    thanks alot I got understood very well !!!

  • @sreekalapm2588
    @sreekalapm2588 3 года назад +1

    Great Thank you Amulya...

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 года назад +1

    Great explanation!

  • @deneenb9152
    @deneenb9152 5 лет назад +2

    Thank you Amul! I'm starting to get an understanding of @property. Keep getting "RecursionError: maximum recursion depth exceeded" with my Class. What would be the reason?
    class Country():
    def __init__(self, name, capital):
    self.name = name
    self.capital = capital
    return
    @property
    def location(self):
    return self.location
    @location.setter
    def location(self, location):
    self.location = location
    print(self.location)
    TT= Country('Trinidad and Tobago', 'Port of Spain')
    TT.location = 'West Indies'
    print(TT.name)
    print(TT.capital)
    print(TT.location)

    • @AmulsAcademy
      @AmulsAcademy  5 лет назад +2

      class Country():
      def __init__(self, name, capital):
      self.name = name
      self.capital = capital
      @property
      def location(self):
      return self.__location
      @location.setter
      def location(self, location):
      self.__location = location
      print("setting value:",self.__location)
      TT= Country('Trinidad and Tobago', 'Port of Spain')
      TT.location = 'West Indies'
      print(TT.name)
      print(TT.capital)
      print(TT.location)

    • @manivelu5424
      @manivelu5424 4 года назад +1

      this because you have used the same values for property and attribute

  • @bhavani9873
    @bhavani9873 3 года назад +1

    Really good thanks sister

  • @CantControl
    @CantControl 4 года назад

    In my code o/p change without using @property. Why?
    I use pycharm editor with python 3.47

  • @MINEDITZZ69
    @MINEDITZZ69 4 года назад +2

    Thank you for nice video. Here if I do not write "self.name=sent[0] & self.grade=sent[-1]" the output will same. So why I use these two lines. Please explain to me.

    • @AmulsAcademy
      @AmulsAcademy  4 года назад

      When i split a string using split() it split string into list.
      Here we know in the message first value or word is student name and last word is grade.
      To access that we are using indexing.
      sent[0] will give you name. [first element of list]
      sent[-1] will give you grade.[last element of list]
      :)

  • @suriyams3519
    @suriyams3519 9 месяцев назад

    Hi ji,
    What is the diff attribute vs member vs constructor?
    If u make already any on the above pls share the link. Or else give short definition.
    Thanks.

  • @likhithap6109
    @likhithap6109 3 года назад +1

    i didnt get how changing msg from attribute to method overcame the problem
    can someone explain

  • @ibrahimali-xd3bw
    @ibrahimali-xd3bw 3 года назад

    Great
    Thank you Amulya.
    what if msg grammatically incorrect , eg. stud1.msg = " Ali A got grade" lol , need more example

  • @ornatetrout
    @ornatetrout Год назад

    Thank you mam. You are amazing.

  • @dchandrakimothi5470
    @dchandrakimothi5470 4 года назад +1

    Amulya Sethi Your pronunciation for the words like:
    N=ann
    L=el
    O=wo
    And it iss the
    is making me to crazy for you.
    Your voice is so adorable that I can't stop me to listening you whole day.

  • @manivelu5424
    @manivelu5424 4 года назад

    ma'am , why don't you just make ======== stud1 = student('amulya', 'b') ========= instead of a setter .

  • @emmysonblack5711
    @emmysonblack5711 Год назад

    The words are big so we ain't seeing well

  • @user-wp8lx2zf9k
    @user-wp8lx2zf9k Год назад

    stop saying metad metad its method

  • @jnscollier
    @jnscollier 4 года назад

    Are you a girl or a boy