Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
| # So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
| # Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
| # | |
| # Let's get started | |
| # | |
| # Let's install nix (at the time of writing this is version 2.5.1 | |
| curl -L https://nixos.org/nix/install | sh | |
| # I might not have needed to, but I rebooted |