Why create this new variable? Can you just check ``if depth == None`` on line 167? I think that would be clearer.