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>
This commit is contained in:
Jacob Hayes 2021-12-08 13:52:57 -05:00 committed by GitHub
parent f893bb2e01
commit 3cb9731b7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -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)