Last active
March 9, 2017 16:29
-
-
Save robinbowes/597df5d3ccd3526ac37beddb94ebce5f to your computer and use it in GitHub Desktop.
Questions about python style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from status_response import StatusResponse | |
class SomeClass: | |
def __init__(self): | |
self._status = "foo" | |
@property | |
def status(self) | |
return self._status | |
def get_status(self): | |
return StatusResponse(self.status).response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StatusResponse: | |
def __init__(self, status): | |
self._status = { "status": status } | |
@property | |
def response(self): | |
return self._status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment