Created
January 8, 2013 00:44
-
-
Save goodwillcoding/4480041 to your computer and use it in GitHub Desktop.
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 Foo(object): | |
_prop1 = None | |
_prop2 = None | |
_prop3 = None | |
def set_prop1(self, value): | |
self._prop1 = self._set_if_valid(value) | |
def set_prop2(self, value): | |
self._prop2 = self._set_if_valid(value) | |
def set_prop3(self, value): | |
self._prop3 = self._set_if_valid(value) | |
def _set_if_valid(self, value): | |
if value == 'hello': | |
raise NameError('bad name') | |
return value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment