Skip to content

Instantly share code, notes, and snippets.

@mhubig
Created October 17, 2011 14:28
Show Gist options
  • Save mhubig/1292712 to your computer and use it in GitHub Desktop.
Save mhubig/1292712 to your computer and use it in GitHub Desktop.
No Getter & Setter ...
class Background(object):
def __init__(self):
self.color = "black"
def handle(self, handler):
handle.do(self)
class Handler(object):
def do(self, object):
object.color = "red"
class Background(object):
def __init__(self):
self.color = "black"
class RedBackground(Background):
def __init__(self):
super(RedBackground).__init__()
self.color = "red"
@mhubig
Copy link
Author

mhubig commented Oct 17, 2011

Was ist besser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment