8000 gh-102615: Fix type vars substitution of `collections.abc.Callable` and custom generics with `ParamSpec` by sobolevn · Pull Request #102681 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
10000

gh-102615: Fix type vars substitution of collections.abc.Callable and custom generics with ParamSpec #102681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address review
  • Loading branch information
sobolevn committed Mar 14, 2023
commit a461b10a5977101c76c665f2be1a9a819f9f6cd7
4 changes: 3 additions & 1 deletion Lib/_collections_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ def __getitem__(self, item):

# This happens in cases like `Callable[P, T][[P, str], bool][int]`,
# we need to flatten the result.
if len(new_args) > 2:
if (len(new_args) > 2
and self.__parameters__
and _is_param_expr(self.__parameters__[0])):
res = []
for new_arg in new_args:
if isinstance(new_arg, tuple):
Expand Down
0