Skip to content

Callable __or__ patch #5753

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions Lib/_collections_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,10 @@ def __getitem__(self, item):
new_args = (t_args, t_result)
return _CallableGenericAlias(Callable, tuple(new_args))

# TODO: RUSTPYTHON patch for common call
def __or__(self, other):
super().__or__(other)

def _is_param_expr(obj):
"""Checks if obj matches either a list of types, ``...``, ``ParamSpec`` or
``_ConcatenateGenericAlias`` from typing.py
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1773,8 +1773,6 @@ def test_run_with_pathlike_path_and_arguments(self):
res = subprocess.run(args)
self.assertEqual(res.returncode, 57)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu")
def test_run_with_an_empty_env(self):
# gh-105436: fix subprocess.run(..., env={}) broken on Windows
Expand Down
9 changes: 9 additions & 0 deletions extra_tests/snippets/stdlib_typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from collections.abc import Awaitable, Callable
from typing import TypeVar

T = TypeVar("T")

def abort_signal_handler(
fn: Callable[[], Awaitable[T]], on_abort: Callable[[], None] | None = None
) -> T:
pass
Loading