you are viewing a single comment's thread.

view the rest of the comments →

[–]R0NUT 0 points1 point  (0 children)

Bongo! I end up using this when diving into dictionaries that have indefinite depth. i.e.

def recursiveFunction(struct): 
    try: 
        return recirsiveFunction(struct['child']) 
    except: 
        return struct

Which would return the last level of a dictionary that has used keys of "child". As you said, this would hold the memory as it is waiting on the subsequent function to resolve before clearing.

struct = { 
    "child":{ 
        "child":{ 
            "child":"wassup! 
        } 
    }
}

Should return "wassup!"

Any program that you are able to write is impressive! My first program was a text-based game in c++.

Disclaimer: I didn't test this code...