Skip to content

Commit db8e579

Browse files
committed
Re-enable PYI034 and use typing.Self
1 parent fd3f92c commit db8e579

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ lint.ignore = [
168168
"PT011", # pytest-raises-too-broad
169169
"PT012", # pytest-raises-with-multiple-statements
170170
"PT017", # pytest-assert-in-except
171-
"PYI034", # flake8-pyi: typing.Self added in Python 3.11
172171
]
173172
lint.per-file-ignores."Tests/oss-fuzz/fuzz_font.py" = [
174173
"I002",

src/PIL/TiffTags.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
from typing import NamedTuple
2222

23+
TYPE_CHECKING = False
24+
if TYPE_CHECKING:
25+
from typing import Self
26+
2327

2428
class _TagInfo(NamedTuple):
2529
value: int | None
@@ -39,7 +43,7 @@ def __new__(
3943
type: int | None = None,
4044
length: int | None = None,
4145
enum: dict[str, int] | None = None,
42-
) -> TagInfo:
46+
) -> Self:
4347
return super().__new__(cls, value, name, type, length, enum or {})
4448

4549
def cvt_enum(self, value: str) -> int | str:

0 commit comments

Comments
 (0)