Skip to content

Instantly share code, notes, and snippets.

@goodwillcoding
Created January 8, 2013 00:44
Show Gist options
  • Save goodwillcoding/4480041 to your computer and use it in GitHub Desktop.
Save goodwillcoding/4480041 to your computer and use it in GitHub Desktop.
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