Skip to content

Instantly share code, notes, and snippets.

View xheisenbugx's full-sized avatar
🏠
Working from home

Osvaldo xheisenbugx

🏠
Working from home
  • ~/.config/nvim
  • 18:38 (UTC -06:00)
View GitHub Profile
@hrldcpr
hrldcpr / tree.md
Last active January 24, 2026 21:18
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!