Skip to content

Instantly share code, notes, and snippets.

@jmquintana79
Last active June 24, 2024 06:09
Show Gist options
  • Save jmquintana79/a1cd28ced6a7660f24832c3715dbd254 to your computer and use it in GitHub Desktop.
Save jmquintana79/a1cd28ced6a7660f24832c3715dbd254 to your computer and use it in GitHub Desktop.
class Credentials():
def __init__(self):
self.user = "user"
self.password = "password"
class Service(Credentials):
def __init__(self):
super().__init__()
print(self.user)
s = Service()
#[out]: "user"
class Credentials():
def __init__(self, user, password):
self.user = user
self.password = password
class Service(Credentials):
def __init__(self, user, password):
super().__init__(user, password)
print(self.user)
s = Service()
#[out]: "user"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment