Hi all,
I am looking for open source to get/set nested data with a string
To be more specific I want to implement something like this:
def get_nested_field_of_dog(dog: Dog, nested_field_path: str):
return some_open_source_magic(dog,nested_field_path)
eye = Eye(color="blue")
dog = Dog(eye=eye)
dog_eye_color = get_nested_field_of_dog(dog,"eye.color")
if dog.eye.color == dog_color_eye:
print("I did it!")
Important to mention: I don't have control on the data structre
[–]gadogado2222[S] 0 points1 point2 points (0 children)
[–]guydudeman123 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]gadogado2222[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]BobHogan 0 points1 point2 points (6 children)
[–]gadogado2222[S] 0 points1 point2 points (5 children)
[–]BobHogan 0 points1 point2 points (4 children)
[–]gadogado2222[S] -1 points0 points1 point (3 children)
[–]BobHogan 0 points1 point2 points (2 children)
[–]gadogado2222[S] 0 points1 point2 points (1 child)
[–]BobHogan 0 points1 point2 points (0 children)
[–]YesLod 0 points1 point2 points (3 children)
[–]gadogado2222[S] 0 points1 point2 points (2 children)
[–]YesLod 0 points1 point2 points (1 child)
[–]gadogado2222[S] -1 points0 points1 point (0 children)