Skip to content

Commit dde2154

Browse files
authored
⬆️ ty 0.0.6 and basedpyright 1.36.2 (#498)
2 parents b4837d2 + 4265398 commit dde2154

File tree

6 files changed

+44
-41
lines changed

6 files changed

+44
-41
lines changed

optype/_core/_can.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class CanEq(Protocol[_T_object_contra, _T_bool_co]): # noqa: PLW1641
385385
"""
386386

387387
@override
388-
def __eq__(self, rhs: _T_object_contra, /) -> _T_bool_co: ... # type: ignore[override] # pyright:ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override]
388+
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]
389389

390390

391391
@runtime_checkable
@@ -396,7 +396,7 @@ class CanNe(Protocol[_T_object_contra, _T_bool_co]):
396396
"""
397397

398398
@override
399-
def __ne__(self, rhs: _T_object_contra, /) -> _T_bool_co: ... # type: ignore[override] # pyright:ignore[reportIncompatibleMethodOverride] # pyrefly: ignore[bad-override]
399+
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]
400400

401401

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

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

455455

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

461461

462462
@runtime_checkable

optype/_core/_just.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __new__( # noqa: PYI019
8585
*args: *tuple[str, tuple[type, ...], dict[str, Any]],
8686
just: type[_ObjectT],
8787
) -> _TypeT:
88-
self = super().__new__(mcls, *args) # type: ignore[misc]
88+
self = super().__new__(mcls, *args) # type: ignore[misc] # ty: ignore[invalid-super-argument]
8989
self.__just_class__ = just # pyrefly: ignore[missing-attribute]
9090
return self
9191

optype/numpy/_scalar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def base(self, /) -> None: ...
5353
@property
5454
def data(self, /) -> memoryview: ...
5555
@property
56-
def dtype(self, /) -> np.dtype[Self]: ... # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments]
56+
def dtype(self, /) -> np.dtype[Self]: ... # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments] # ty: ignore[invalid-type-arguments]
5757
@property
5858
def flags(self, /) -> Any: ...
5959
@property

optype/typing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,23 @@ class Just( # type: ignore[misc]
7272
"and will be removed in optype 0.10.0",
7373
)
7474
@runtime_checkable
75-
class JustInt(_just.JustInt, Protocol, just=int): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
75+
class JustInt(_just.JustInt, Protocol, just=int): ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # ty:ignore[subclass-of-final-class]
7676

7777

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

8585

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

9393

9494
Just.__doc__ = _just.Just.__doc__ # pyright: ignore[reportDeprecated] # ty:ignore[deprecated]

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ test = [
8080
type = [
8181
{ include-group = "extra" },
8282
{ include-group = "test" },
83-
"basedpyright>=1.36.1",
83+
"basedpyright>=1.36.2",
8484
"mypy[faster-cache]>=1.19.1",
8585
"pyrefly==0.46.0",
86-
"ty==0.0.5",
86+
"ty==0.0.6",
8787
]
8888
dev = [
8989
{ include-group = "extra" },
@@ -153,8 +153,11 @@ include = [
153153
# "tests",
154154
]
155155

156+
[tool.ty.analysis]
157+
respect-type-ignore-comments = false # for mypy compat
158+
156159
[tool.ty.rules]
157-
# unused-ignore-comment = "warn" # will also complain about mypy `# type: ignore` comments
160+
unused-ignore-comment = "warn"
158161
possibly-unresolved-reference = "error"
159162

160163
# pytest

0 commit comments

Comments
 (0)