Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # a lot of code ommitted
- class FilterAction():
- important_attribute = "I am important"
- def __init__(self, important_attribute=None):
- self.important_attribute = important_attribute or getattr(self, "important_attribute")
- class MyGreatFilterAction(FilterAction):
- important_attribute = "I am not so important in this class"
- def print_important_attribute(self):
- print self.important_attribute
- m = MyGreatFilterAction()
- m.print_important_attribute()
- m = MyGreatFilterAction("I can be important for this object")
- m.print_important_attribute()
-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement