Skip to content

Commit ba64a74

Browse files
oprypincopybara-github
authored andcommitted
Add a comment about collections.abc vs typing
See https://docs.python.org/3/library/typing.html#typing.AbstractSet PiperOrigin-RevId: 683161346
1 parent c90d6df commit ba64a74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytype/overlays/collections_overlay.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ class ABCOverlay(typing_overlay.Redirect):
3333
"""A custom overlay for the 'collections.abc' module."""
3434

3535
def __init__(self, ctx):
36-
super().__init__("collections.abc", {"Set": "typing.AbstractSet"}, ctx)
36+
# collections.abc.Set equates to typing.AbstractSet rather than typing.Set.
37+
# This is the only such mismatch.
38+
aliases = {"Set": "typing.AbstractSet"}
39+
super().__init__("collections.abc", aliases, ctx)

0 commit comments

Comments
 (0)