Skip to content

Commit

Permalink
Fix linting issues (#12898)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
AlexWaygood and pre-commit-ci[bot] authored Oct 24, 2024
1 parent 783171b commit 9ed47fa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
3 changes: 2 additions & 1 deletion stdlib/@tests/test_cases/check_os_path.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

from _typeshed import StrOrBytesPath
from os import PathLike
from os.path import abspath, expanduser, expandvars
from typing_extensions import assert_type
from typing import AnyStr, Union
from typing_extensions import assert_type


def test_str_path(str_path: StrOrBytesPath) -> None:
Expand Down
1 change: 0 additions & 1 deletion stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,6 @@ class NodeVisitor:
@deprecated("Replaced by visit_Constant; removed in Python 3.14")
def visit_Ellipsis(self, node: Ellipsis) -> Any: ... # type: ignore[deprecated]


class NodeTransformer(NodeVisitor):
def generic_visit(self, node: AST) -> AST: ...
# TODO: Override the visit_* methods with better return types.
Expand Down
2 changes: 1 addition & 1 deletion stdlib/warnings.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
import re
import sys
from _warnings import warn as warn, warn_explicit as warn_explicit
from collections.abc import Sequence
from types import ModuleType, TracebackType
Expand Down
2 changes: 1 addition & 1 deletion stubs/netifaces/netifaces.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Literal, Final
from typing import Final, Literal

AF_12844: Final[int]
AF_APPLETALK: Final[int]
Expand Down
16 changes: 4 additions & 12 deletions stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,9 @@ class WithDescriptorsStrict(Strict):
with_descriptors.text_int_not_none = None # type: ignore
with_descriptors.text_int_not_none = object() # type: ignore
# If expected type (_T) is not str, it's impossible to use an Element as the value
with_descriptors.text_int_not_none = cast( # type: ignore
_HasTagAndGet[int], _
)
with_descriptors.text_int_not_none = cast( # type: ignore
_HasTagAndGet[None], _
)
with_descriptors.text_int_not_none = cast( # type: ignore
_HasTagAndGet[str], _
)
with_descriptors.text_int_not_none = cast(_HasTagAndGet[int], _) # type: ignore
with_descriptors.text_int_not_none = cast(_HasTagAndGet[None], _) # type: ignore
with_descriptors.text_int_not_none = cast(_HasTagAndGet[str], _) # type: ignore

with_descriptors.text_int_none = 0
with_descriptors.text_int_none = "0"
Expand All @@ -336,9 +330,7 @@ class WithDescriptorsStrict(Strict):
with_descriptors.minmax_float = None # type: ignore
with_descriptors.minmax_float = object() # type: ignore
with_descriptors.minmax_float = cast(_HasTagAndGet[float], _)
with_descriptors.minmax_float = cast( # type: ignore
_HasTagAndGet[None], _
)
with_descriptors.minmax_float = cast(_HasTagAndGet[None], _) # type: ignore
with_descriptors.minmax_float = cast(_HasTagAndGet[object], _) # type: ignore

with_descriptors.minmax_float_none = 0
Expand Down

0 comments on commit 9ed47fa

Please sign in to comment.