FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Callable __or__ patch by arihant2math · Pull Request #5753 · RustPython/RustPython · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions Lib/_collections_abc.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ def __getitem__(self, item):
new_args = (t_args, t_result)
return _CallableGenericAlias(Callable, tuple(new_args))

# TODO: RUSTPYTHON patch for common call
Comment thread
arihant2math marked this conversation as resolved.
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
10 changes: 10 additions & 0 deletions extra_tests/snippets/stdlib_typing.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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

Back | FazBrowse Home | New Git URL