Skip to content

Commit 4cca8b0

Browse files
authored
Callable __or__ patch (RustPython#5753)
* callable __or__ patch * add test
2 parents 47a7a00 + 1597698 commit 4cca8b0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Lib/_collections_abc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ def __getitem__(self, item):
512512
new_args = (t_args, t_result)
513513
return _CallableGenericAlias(Callable, tuple(new_args))
514514

515+
# TODO: RUSTPYTHON patch for common call
516+
def __or__(self, other):
517+
super().__or__(other)
518+
515519
def _is_param_expr(obj):
516520
"""Checks if obj matches either a list of types, ``...``, ``ParamSpec`` or
517521
``_ConcatenateGenericAlias`` from typing.py
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from collections.abc import Awaitable, Callable
2+
from typing import TypeVar
3+
4+
T = TypeVar("T")
5+
6+
7+
def abort_signal_handler(
8+
fn: Callable[[], Awaitable[T]], on_abort: Callable[[], None] | None = None
9+
) -> T:
10+
pass

0 commit comments

Comments
 (0)