Created
August 5, 2023 06:07
-
-
Save Laharah/6968b9420aeefeb2861c8aa25c390ba6 to your computer and use it in GitHub Desktop.
for geist
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 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