How does the @property decorator work in Python?

后端 未结 13 2127
闹比i
闹比i 2020-11-21 04:49

I would like to understand how the built-in function property works. What confuses me is that property can also be used as a decorator, but it only

13条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-21 05:31

    The best explanation can be found here: Python @Property Explained – How to Use and When? (Full Examples) by Selva Prabhakaran | Posted on November 5, 2018

    It helped me understand WHY not only HOW.

    https://www.machinelearningplus.com/python/python-property/

提交回复
热议问题