Python getter method | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Python getter method

if i want to get an argument from a class i can simply define a function named sane as the argument with the @property decorator above, then what is the reason for using the getter decorator (@name.getter)?? thanks in advance

15th Dec 2018, 3:25 PM
Amine Tahiri
Amine Tahiri - avatar
1 ответ
+ 1
A getter method is used to control future implemntations of the recieving of a field without breaking backwards conpatibility.
15th Dec 2018, 3:41 PM
Freetoast
Freetoast - avatar