Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Created June 13, 2018 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IuryAlves/b8718fc16f50916e55b506fd7f9b1a5b to your computer and use it in GitHub Desktop.
Save IuryAlves/b8718fc16f50916e55b506fd7f9b1a5b to your computer and use it in GitHub Desktop.
def get_depth(self):
parent = self.parent
depth = 0
while parent is not None:
parent = parent.parent
depth += 1
return depth
# coloca isso na classe Link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment