mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix linting issues (#12898)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Literal, Final
|
||||
from typing import Final, Literal
|
||||
|
||||
AF_12844: Final[int]
|
||||
AF_APPLETALK: Final[int]
|
||||
|
||||
@@ -304,15 +304,9 @@ with_descriptors.text_int_not_none = "0"
|
||||
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"
|
||||
@@ -336,9 +330,7 @@ with_descriptors.minmax_float = 0.0
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user