ufunc |
identity |
arg |
out |
|---|---|---|---|
isnat |
Mm |
? |
|
signbit |
efdg |
? |
|
isfinite |
?bBhHiIlLqQefdgFDGmM |
? |
|
isinf |
?bBhHiIlLqQefdgFDGmM |
? |
|
isnan |
?bBhHiIlLqQefdgFDGmMT |
? |
|
bitwise_count |
bBhHiIlLqQO |
BO |
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
| note: unused allowlist entry scipy\._lib\.(array_api_(compat|extra)|cobyqa|pyprima).* | |
| note: unused allowlist entry scipy\.fft\._pocketfft\..* | |
| scipy.__all__ | |
| scipy._lib._array_api.__all__ | |
| scipy._lib._array_api.array_namespace | |
| scipy._lib._array_api.is_pydata_sparse_array | |
| scipy._lib._array_api.make_xp_pytest_param | |
| scipy._lib._array_api.xp_capabilities | |
| scipy._lib._array_api_compat_vendor | |
| scipy._lib._array_api_docs_tables.is_inherently_out_of_scope |
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
| from typing import Protocol, Literal, reveal_type | |
| class CanRMul[InT, OutT](Protocol): | |
| def __rmul__(self, other: InT, /) -> OutT: ... | |
| def twice[OutT](x: CanRMul[Literal[2], OutT]) -> OutT: | |
| return 2 * x |
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
| { | |
| "label": "", | |
| "message": "ty", | |
| "logoSvg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\"><path d=\"M48 7.7H27.8V0h-24v7.7H0v18.2h3.8v14.3c0 4.3 3.5 7.8 7.8 7.8H48V29.8H27.8v-3.9h12.4c4.3 0 7.8-3.5 7.8-7.8V7.7Z\" fill=\"#46ebe1\"/></svg>", | |
| "logoWidth": 10, | |
| "labelColor": "grey", | |
| "color": "#261230" | |
| } |
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
| module | usage_count | |
|---|---|---|
| scipy.stats | 1556 | |
| scipy.signal | 1506 | |
| scipy.linalg | 1342 | |
| scipy.optimize | 1319 | |
| scipy.sparse | 748 | |
| scipy.interpolate | 497 | |
| scipy.special | 441 | |
| scipy.ndimage | 434 | |
| scipy.spatial | 417 |
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
| trait Family { | |
| type Member<T>; | |
| } | |
| trait Functor<A> { | |
| type Of: Family<Member<A> = Self>; | |
| fn fmap<B>(self, f: impl FnMut(A) -> B) -> <Self::Of as Family>::Member<B>; | |
| } | |
| // |
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
| import subprocess | |
| from pathlib import Path | |
| # see https://github.com/astral-sh/ruff/pull/18224 | |
| from ruff.__main__ import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs] | |
| find_ruff_bin, # noqa: PLC2701 | |
| ) | |
| def ruff_format(source: str) -> str: |
original post: scipy/scipy-stubs#153 (comment)
Annotating a function whose return type depends on an optional positional- or keyword-only parameter in Python
Overloads are roughly similar to pattern matching[^1], but from the perspective of the caller.
Consider this function for example
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
| import itertools, typing | |
| def primes(n: int, /) -> typing.Generator[int]: | |
| yield next(sieve := itertools.count(prime := 2)) | |
| for _ in range(n): | |
| yield (prime := next(sieve := filter(prime.__rmod__, sieve))) |
NewerOlder



