Created
September 21, 2018 15:08
-
-
Save EdMan1022/a3c0b1db52fefdf43d5642488265efa4 to your computer and use it in GitHub Desktop.
Quick dirty example of freely passing args to parent class
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 ExampleParent(object): | |
def run(self, *args, **kwargs): | |
print(args[0]) | |
print(kwargs['a']) | |
class ExampleChild(ExampleParent): | |
def run(self, *args, **kwargs): | |
super(ExampleChild, self).run(*args, **kwargs) | |
if __name__ == '__main__': | |
child = ExampleChild() | |
child.run(1, 2, 3, a='lol') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment