Opened 4 years ago

Last modified 22 months ago

#32528 closed Cleanup/optimization

Replace django.utils.topological_sort with graphlib. — at Initial Version

Reported by: Nick Pope Owned by: Nick Pope
Component: Utilities Version: dev
Severity: Normal Keywords: backport, graphlib, toposort, topological sort
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In Python 3.9 we have a new standard library module, graphlib, that includes a topological sort implementation.
Let's use this instead of our custom implementation in django.utils.topological_sort.

This will require a backport for Python 3.8, the minimum supported version for Django 4.0, but when support for Python 3.8 is removed we can simply drop the backport. When using Python 3.9+ we'll just use the module direct from the standard library.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top