Skip to content

Commit

Permalink
Add a comment about collections.abc vs typing
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin authored and copybara-github committed Oct 7, 2024
1 parent c90d6df commit ba64a74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytype/overlays/collections_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ class ABCOverlay(typing_overlay.Redirect):
"""A custom overlay for the 'collections.abc' module."""

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

0 comments on commit ba64a74

Please sign in to comment.