Hacker News new | past | comments | ask | show | jobs | submit login

    __SOME_VAR = "foo"


    @property
    def some_var(self):
        return self.__SOME_VAR

?



Yes, just like that. Check out this fantastic talk on being pythonic: https://www.youtube.com/watch?v=wf-BqAjZb8M




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: