Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/graphlib.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from types import GenericAlias

__all__ = ["TopologicalSorter", "CycleError"]

_NODE_OUT = -1
Expand Down Expand Up @@ -244,3 +246,5 @@ def static_order(self):
node_group = self.get_ready()
yield from node_group
self.done(*node_group)

__class_getitem__ = classmethod(GenericAlias)
2 changes: 2 additions & 0 deletions Lib/test/test_genericalias.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from contextvars import ContextVar, Token
from dataclasses import Field
from functools import partial, partialmethod, cached_property
from graphlib import TopologicalSorter
from mailbox import Mailbox, _PartialFile
try:
import ctypes
Expand Down Expand Up @@ -56,6 +57,7 @@ class BaseTest(unittest.TestCase):
OrderedDict, Counter, UserDict, UserList,
Pattern, Match,
partial, partialmethod, cached_property,
TopologicalSorter,
AbstractContextManager, AbstractAsyncContextManager,
Awaitable, Coroutine,
AsyncIterable, AsyncIterator,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement :pep:`585` for :class:`graphlib.TopologicalSorter`.