import pathlib current = pathlib.Path(__file__).parent root = current.parent import sys sys.path.append(str(root)) import assets class deep(assets.deep_request): @property def has_x(self): return self.x is not None print("Testing.") test = deep({ "a": 10, "b": 20 }) print("Test.a: " + str(test.a)) print("Test.b: " + str(test.b)) print("Test.x: " + str(test.x)) print("Test.has_x: " + str(test.has_x)) print() print("Testing.") test = deep({ "a": 10, "b": 20, "x": 30 }) print("Test.a: " + str(test.a)) print("Test.b: " + str(test.b)) print("Test.x: " + str(test.x)) print("Test.has_x: " + str(test.has_x)) print()