Created
January 4, 2019 15:41
-
-
Save solalatus/bd59ae03f34b599f2482da85d3ddfa2d to your computer and use it in GitHub Desktop.
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 ABC(): | |
def __init__(my_parameter): | |
self.my_object_variable = my_parameter | |
def whatever_shit(): | |
print(self.my_object_variable) | |
def return_value(): | |
return self.my_object_variable | |
class Xyz(): | |
def __init__(my_parameter_holding_another_object): | |
self.my_object_variable = my_parameter_holding_another_object | |
def return_subobject_value(): | |
return self.my_object_variable.return_value() | |
instance = ABC("this is the parameter") | |
instance.whatever_shit() | |
second_instance = Xyz(instance) | |
assert second_instance.return_subobject_value() == instance.return_value() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment