How to get setters and getters in python
To use the following: class MyClass: def __init__(self): self.title = None @title.setter def title(self, title): print ('TITLE SETTER: %s' % title) self._title = title NameError: name 'title' is not defined What's wrong with the above code?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.