spanezz / staticsite

Static site generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use graphlib.TopologicalSorter if available

spanezz opened this issue · comments

Python 3.9 introduced graphlib.TopologicalSorter.

Staticsite could use it by default, and fallback to the internal implementation (currently in staticsite/toposort.py) for older Python versions that don't have it in the standard library.

It's also worth refactoring toposort to match the API of graphlib.TopologicalSorter, turning it into a polyfill kind of thing.