Created
September 26, 2023 06:43
-
-
Save nenetto/0fc3bb90c4532e1390533473ba40b20f to your computer and use it in GitHub Desktop.
Class super for initialization
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 MyBaseClass: | |
def __init__(self, value): | |
self._value = value | |
class Explicit(MyBaseClass): | |
def __init__(self, value): | |
super(__class__, self).__init__(value * 2) | |
class Implicit(MyBaseClass): | |
def __init__(self, value): | |
super().__init__(value * 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment