Jacob Hayes added the comment:
Thanks for the tips! I've been using this patch in my own code in a early
imported `__init__.py`:
```
from graphlib import TopologicalSorter
from types import GenericAlias
if not hasattr(TopologicalSorter, "__class_getitem__"): # pragma
Jacob Hayes added the comment:
Thanks for merging!
Should typeshed be updated for <3.11 in the meantime or do you suggest `if
TYPE_CHECKING` blocks on user side? Perhaps it's a non-issue if no one else has
noticed this. :)
--
___
Python trac
Change by Jacob Hayes :
--
keywords: +patch
pull_requests: +27064
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28714
___
Python tracker
<https://bugs.python.org/issu
New submission from Jacob Hayes :
Reproduction:
```
from graphlib import TopologicalSorter
TopologicalSorter[str]({"a": {}, "b": {"a"}})
```
```
$ mypy /tmp/toposort.py
Success: no issues found in 1 source file
$ python3 /tmp/toposort.py
Traceback (most r
New submission from Jacob Hayes :
When deepcopying a parametrized types.GenericAlias (eg: a dict subclass) that
has a __deepcopy__ method, the copy module doesn't detect the GenericAlias as a
type and instead tries to call cls.__deepcopy__, passing `memo` inplace of
self. This doesn't seem