+ 1
Python 3 - Properties
Hi All, does anyone have any clue to using a decorator to add a setter for a particular property?
2 Respostas
+ 1
@your_property.setter
0
its in the courses but just add @your_var.setter above a function with the same name as your_var (in this example) and then this function will be called when ever someone calls myclass.your_var = value parsing value to your setter function