3 ms·
__SOME_VAR = "foo" @property def some_var(self): return self.__SOME_VAR ?
by pryelluw 9y ago
__SOME_VAR = "foo"
@property
def some_var(self):
return self.__SOME_VAR
?
- TremendousJudge 9y agoYes, just like that. Check out this fantastic talk on being pythonic: https://www.youtube.com/watch?v=wf-BqAjZb8M https://www.youtube.com/watch?v=wf-BqAjZb8M