Skip to content

Instantly share code, notes, and snippets.

@Laharah
Created August 5, 2023 06:07
Show Gist options
  • Save Laharah/6968b9420aeefeb2861c8aa25c390ba6 to your computer and use it in GitHub Desktop.
Save Laharah/6968b9420aeefeb2861c8aa25c390ba6 to your computer and use it in GitHub Desktop.
for geist
class SuperA:
def a_method(self):
print("I'm from a")
class SuperB:
def __init__(self):
self.statment = "crap"
def b_method(self):
print("I'm from b")
@classmethod
def deseralize(cls, s):
b_obj = cls()
b_obj.statement = s
return b_obj
class MyClass(SuperB, SuperA):
@classmethod
def from_b(cls):
new_statment = "fuck"
my_class_obj = cls()
b_obj = super().deseralize(new_statement)
for key, value in b_obj.__dict__.items():
my_class_obj.__dict__[key] = value
return my_class_obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment