Skip to content

mypy: fix all operator issues #363

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

Merged
merged 3 commits into from
May 5, 2025
Merged
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ disable_error_code = [
"attr-defined",
"misc",
"no-redef",
"operator",
"override",
"return",
"valid-type",
Expand Down
5 changes: 3 additions & 2 deletions stubs/networkx/algorithms/community/quality.pyi
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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): ...
Expand Down
6 changes: 4 additions & 2 deletions stubs/sympy-stubs/core/cache.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Expand All @@ -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): ...
Expand Down
8 changes: 7 additions & 1 deletion stubs/sympy-stubs/integrals/meijerint.pyi
Original file line number Diff line number Diff line change
@@ -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): ...

Expand Down
12 changes: 6 additions & 6 deletions stubs/sympy-stubs/polys/domains/gaussiandomains.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...
Expand All @@ -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 = ...
Expand Down
6 changes: 4 additions & 2 deletions stubs/sympy-stubs/series/gruntz.pyi
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
6 changes: 4 additions & 2 deletions stubs/sympy-stubs/utilities/misc.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Expand All @@ -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: ...
Expand Down