diff --git a/pyproject.toml b/pyproject.toml index 3bcacb9f..64d991ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,7 +130,6 @@ disable_error_code = [ "attr-defined", "misc", "no-redef", - "operator", "override", "return", "valid-type", diff --git a/stubs/networkx/algorithms/community/quality.pyi b/stubs/networkx/algorithms/community/quality.pyi index a3de5f46..fc17f91e 100644 --- a/stubs/networkx/algorithms/community/quality.pyi +++ b/stubs/networkx/algorithms/community/quality.pyi @@ -1,5 +1,6 @@ -from collections.abc import Sequence +from collections.abc import Callable, Sequence from itertools import combinations +from typing import TypeVar from networkx import NetworkXError @@ -13,7 +14,7 @@ __all__ = ["coverage", "modularity", "performance", "partition_quality"] class NotAPartition(NetworkXError): def __init__(self, G: Graph, collection): ... -require_partition = ... +require_partition: argmap def intra_community_edges(G: Graph, partition): ... def inter_community_edges(G: Graph, partition): ... diff --git a/stubs/sympy-stubs/core/cache.pyi b/stubs/sympy-stubs/core/cache.pyi index bb43478f..e687de20 100644 --- a/stubs/sympy-stubs/core/cache.pyi +++ b/stubs/sympy-stubs/core/cache.pyi @@ -1,4 +1,6 @@ -from typing import Callable +from typing import Callable, TypeVar + +_CallableT = TypeVar("_CallableT", bound=Callable) class _cache(list): def print_cache(self) -> None: ... @@ -10,8 +12,8 @@ clear_cache = ... USE_CACHE = ... scs = ... SYMPY_CACHE_SIZE = ... -cacheit = ... +def cacheit(func: _CallableT) -> _CallableT: ... def cached_property(func) -> property: ... def lazy_function(module: str, name: str) -> Callable: class LazyFunctionMeta(type): ... diff --git a/stubs/sympy-stubs/integrals/meijerint.pyi b/stubs/sympy-stubs/integrals/meijerint.pyi index 8f971d6f..1bb90a5b 100644 --- a/stubs/sympy-stubs/integrals/meijerint.pyi +++ b/stubs/sympy-stubs/integrals/meijerint.pyi @@ -1,9 +1,15 @@ +from collections.abc import Callable +from typing import TypeVar + from sympy.core.basic import Basic from sympy.core.symbol import Dummy from sympy.functions.elementary.piecewise import Piecewise +_CallableT = TypeVar("_CallableT", bound=Callable) + z = ... -timeit = ... + +def timeit(func: _CallableT) -> _CallableT: ... class _CoeffExpValueError(ValueError): ... diff --git a/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi b/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi index 2a0811ec..7f8a7491 100644 --- a/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi +++ b/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi @@ -76,9 +76,9 @@ class GaussianDomain: class GaussianIntegerRing(GaussianDomain, Ring): dom = ... dtype = GaussianInteger - zero = dtype(ZZ(0), ZZ(0)) - one = dtype(ZZ(1), ZZ(0)) - imag_unit = dtype(ZZ(0), ZZ(1)) + zero: GaussianInteger + one: GaussianInteger + imag_unit: GaussianInteger units = ... rep = ... is_GaussianRing = ... @@ -95,9 +95,9 @@ class GaussianIntegerRing(GaussianDomain, Ring): class GaussianRationalField(GaussianDomain, Field): dom = ... dtype = GaussianRational - zero = dtype(QQ(0), QQ(0)) - one = dtype(QQ(1), QQ(0)) - imag_unit = dtype(QQ(0), QQ(1)) + zero: GaussianInteger + one: GaussianInteger + imag_unit: GaussianInteger units = ... rep = ... is_GaussianField = ... diff --git a/stubs/sympy-stubs/series/gruntz.pyi b/stubs/sympy-stubs/series/gruntz.pyi index 161cefc0..f21d0f0a 100644 --- a/stubs/sympy-stubs/series/gruntz.pyi +++ b/stubs/sympy-stubs/series/gruntz.pyi @@ -1,12 +1,14 @@ -from typing import Any, Literal +from collections.abc import Callable +from typing import Any, Literal, TypeVar from sympy.core.basic import Basic from sympy.core.cache import cacheit from sympy.core.function import UndefinedFunction from sympy.utilities.misc import debug_decorator as debug -timeit = ... +_CallableT = TypeVar("_CallableT", bound=Callable) +def timeit(func: _CallableT) -> _CallableT: ... def compare(a, b, x) -> Literal["<", ">", "="]: ... class SubsSet(dict): diff --git a/stubs/sympy-stubs/utilities/misc.pyi b/stubs/sympy-stubs/utilities/misc.pyi index 6fe1e4f9..2e83f937 100644 --- a/stubs/sympy-stubs/utilities/misc.pyi +++ b/stubs/sympy-stubs/utilities/misc.pyi @@ -1,6 +1,8 @@ -from typing import Any, Callable +from typing import Any, Callable, TypeVar from typing_extensions import LiteralString +_CallableT = TypeVar("_CallableT", bound=Callable) + class Undecidable(ValueError): ... def filldedent(s, w=..., **kwargs) -> str: ... @@ -12,7 +14,7 @@ HASH_RANDOMIZATION = ... _debug_tmp: list[str] = ... _debug_iter = ... -def debug_decorator(func) -> Callable[..., Any]: ... +def debug_decorator(func: _CallableT) -> _CallableT: ... def debug(*args) -> None: ... def debugf(string, args) -> None: ... def find_executable(executable, path=...) -> str | None: ...