Skip to content
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
8 changes: 4 additions & 4 deletions optype/_core/_can.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class CanEq(Protocol[_T_object_contra, _T_bool_co]): # noqa: PLW1641
"""

@override
def __eq__(self, rhs: _T_object_contra, /) -> _T_bool_co: ... # type: ignore[override] # pyright:ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override]
def __eq__(self, rhs: _T_object_contra, /) -> _T_bool_co: ... # type: ignore[override] # pyright:ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override] # ty: ignore[invalid-method-override]


@runtime_checkable
Expand All @@ -396,7 +396,7 @@ class CanNe(Protocol[_T_object_contra, _T_bool_co]):
"""

@override
def __ne__(self, rhs: _T_object_contra, /) -> _T_bool_co: ... # type: ignore[override] # pyright:ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override]
def __ne__(self, rhs: _T_object_contra, /) -> _T_bool_co: ... # type: ignore[override] # pyright:ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override] # ty: ignore[invalid-method-override]


@runtime_checkable
Expand Down Expand Up @@ -450,13 +450,13 @@ class CanSetattr(Protocol[_T_object_contra]):
"""Note that `isinstance(x, CanSetattr)` is always true."""

@override
def __setattr__(self, name: str, value: _T_object_contra, /) -> _Ignored: ... # type: ignore[misc, override] # pyright: ignore[reportIncompatibleMethodOverride]
def __setattr__(self, name: str, value: _T_object_contra, /) -> _Ignored: ... # type: ignore[misc, override] # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]


@runtime_checkable
class CanDelattr(Protocol):
@override
def __delattr__(self, name: str, /) -> _Ignored: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override]
def __delattr__(self, name: str, /) -> _Ignored: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override] # ty: ignore[invalid-method-override]


@runtime_checkable
Expand Down
2 changes: 1 addition & 1 deletion optype/_core/_just.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __new__( # noqa: PYI019
*args: *tuple[str, tuple[type, ...], dict[str, Any]],
just: type[_ObjectT],
) -> _TypeT:
self = super().__new__(mcls, *args) # type: ignore[misc]
self = super().__new__(mcls, *args) # type: ignore[misc] # ty: ignore[invalid-super-argument]
self.__just_class__ = just # pyrefly: ignore[missing-attribute]
return self

Expand Down
2 changes: 1 addition & 1 deletion optype/numpy/_scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def base(self, /) -> None: ...
@property
def data(self, /) -> memoryview: ...
@property
def dtype(self, /) -> np.dtype[Self]: ... # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments]
def dtype(self, /) -> np.dtype[Self]: ... # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments] # ty: ignore[invalid-type-arguments]
@property
def flags(self, /) -> Any: ...
@property
Expand Down
6 changes: 3 additions & 3 deletions optype/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ class Just( # type: ignore[misc]
"and will be removed in optype 0.10.0",
)
@runtime_checkable
class JustInt(_just.JustInt, Protocol, just=int): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
class JustInt(_just.JustInt, Protocol, just=int): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # ty:ignore[subclass-of-final-class]


@deprecated(
"`optype.typing.JustFloat` has been deprecated in favor of `optype.JustFloat` "
"and will be removed in optype 0.10.0",
)
@runtime_checkable
class JustFloat(_just.JustFloat, Protocol, just=float): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
class JustFloat(_just.JustFloat, Protocol, just=float): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # ty:ignore[subclass-of-final-class]


@deprecated(
"`optype.typing.JustComplex` has been deprecated in favor of `optype.JustComplex` "
"and will be removed in optype 0.10.0",
)
@runtime_checkable
class JustComplex(_just.JustComplex, Protocol, just=complex): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
class JustComplex(_just.JustComplex, Protocol, just=complex): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # ty:ignore[subclass-of-final-class]


Just.__doc__ = _just.Just.__doc__ # pyright: ignore[reportDeprecated] # ty:ignore[deprecated]
Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ test = [
type = [
{ include-group = "extra" },
{ include-group = "test" },
"basedpyright>=1.36.1",
"basedpyright>=1.36.2",
"mypy[faster-cache]>=1.19.1",
"pyrefly==0.46.0",
"ty==0.0.5",
"ty==0.0.6",
]
dev = [
{ include-group = "extra" },
Expand Down Expand Up @@ -153,8 +153,11 @@ include = [
# "tests",
]

[tool.ty.analysis]
respect-type-ignore-comments = false # for mypy compat

[tool.ty.rules]
# unused-ignore-comment = "warn" # will also complain about mypy `# type: ignore` comments
unused-ignore-comment = "warn"
possibly-unresolved-reference = "error"

# pytest
Expand Down
Loading