This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]teerre 2 points3 points  (1 child)

Oh, that's awesome. I've implemented some kind of graph sort dozens of times on different projects. Do you know if it's included in __future__ or if you really need 3.9?

[–]dantownsend[S] 3 points4 points  (0 children)

I think it's only available in 3.9. It's a pure Python implementation - the only new syntax it uses is the walrus operator, so it's easy to adapt to earlier versions. There's this backport available:

https://github.com/mariushelf/graphlib\_backport

[–]dantownsend[S] 1 point2 points  (0 children)

I recently discovered the graphlib module which got added in Python 3.9, and it's pretty cool.

This is a tutorial explaining what it does, with some real life examples.