diff options
author | Jacob Hayes <jacob.r.hayes@gmail.com> | 2021-12-08 18:52:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 18:52:57 (GMT) |
commit | 3cb9731b7e59b0df9a7a9ab6b7746a669958b693 (patch) | |
tree | 6b7285ea240da0b8f8ea18cffab8bb0f3c4ae4e6 /Lib/graphlib.py | |
parent | f893bb2e01307c92ca19597f44874ecaffe7f06f (diff) | |
download | cpython-3cb9731b7e59b0df9a7a9ab6b7746a669958b693.zip cpython-3cb9731b7e59b0df9a7a9ab6b7746a669958b693.tar.gz cpython-3cb9731b7e59b0df9a7a9ab6b7746a669958b693.tar.bz2 |
bpo-45359: Support TopologicalSorter type subscript (GH-28714)
* Support TopologicalSorter type subscript
* 📜🤖 Added by blurb_it.
* Add TopologicalSorter to GenericAlias tests
* Update Misc/NEWS.d/next/Library/2021-10-03-22-27-35.bpo-45359.LX_uxe.rst
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Diffstat (limited to 'Lib/graphlib.py')
-rw-r--r-- | Lib/graphlib.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/graphlib.py b/Lib/graphlib.py index 1c5d9a4..6365456 100644 --- a/Lib/graphlib.py +++ b/Lib/graphlib.py @@ -1,3 +1,5 @@ +from types import GenericAlias + __all__ = ["TopologicalSorter", "CycleError"] _NODE_OUT = -1 @@ -244,3 +246,5 @@ class TopologicalSorter: node_group = self.get_ready() yield from node_group self.done(*node_group) + + __class_getitem__ = classmethod(GenericAlias) |