Skip to content

Commit 4d8ae17

Browse files
Bump mypy to 1.9, add to json.encoder, small fixups (#11549)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 5b1fd12 commit 4d8ae17

File tree

40 files changed

+71
-90
lines changed

40 files changed

+71
-90
lines changed

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ black==24.1.1 # must match .pre-commit-config.yaml
55
flake8==7.0.0 # must match .pre-commit-config.yaml
66
flake8-noqa==1.4.0 # must match .pre-commit-config.yaml
77
flake8-pyi==24.1.0 # must match .pre-commit-config.yaml
8-
mypy==1.8.0
8+
mypy==1.9.0
99
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
1010
pytype==2024.2.27; platform_system != "Windows" and python_version < "3.12"
1111
ruff==0.3.0 # must match .pre-commit-config.yaml

stdlib/json/encoder.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ INFINITY: float
1010

1111
def py_encode_basestring(s: str) -> str: ... # undocumented
1212
def py_encode_basestring_ascii(s: str) -> str: ... # undocumented
13+
def encode_basestring(s: str) -> str: ... # undocumented
14+
def encode_basestring_ascii(s: str) -> str: ... # undocumented
1315

1416
class JSONEncoder:
1517
item_separator: str

stdlib/ssl.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ _PasswordType: TypeAlias = Callable[[], str | bytes | bytearray] | str | bytes |
1515

1616
_SrvnmeCbType: TypeAlias = Callable[[SSLSocket | SSLObject, str | None, SSLSocket], int | None]
1717

18+
socket_error = OSError
19+
1820
class _Cipher(TypedDict):
1921
aead: bool
2022
alg_bits: int

stubs/aiofiles/aiofiles/ospath.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ async def samefile(
1717
f1: FileDescriptorOrPath, f2: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
1818
) -> bool: ...
1919
async def sameopenfile(fp1: int, fp2: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...
20+
async def islink(path: FileDescriptorOrPath) -> bool: ...
21+
async def ismount(path: FileDescriptorOrPath) -> bool: ...

stubs/boltons/@tests/stubtest_allowlist.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ boltons.strutils.int_list_to_int_tuples
55
# Internal compatibility aliases
66
boltons.cacheutils.basestring
77
boltons.funcutils.basestring
8-
boltons.funcutils.inspect_formatargspec
98
boltons.funcutils.make_method
109
boltons.iterutils.basestring
10+
11+
boltons.cacheutils.bytes
12+
boltons.cacheutils.str
13+
boltons.cacheutils.unicode
14+
boltons.cacheutils.xrange
15+
boltons.deprutils.ModuleType.__dict__
16+
boltons.deprutils.ModuleType.__getattr__
17+
boltons.iterutils.unicode
18+
boltons.iterutils.xrange
19+
boltons.mathutils.unicode
20+
boltons.urlutils.OMD
21+
boltons.urlutils.unichr
22+
boltons.urlutils.unicode

stubs/chevron/chevron/renderer.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ from typing import Any, Literal
44

55
g_token_cache: dict[str, list[tuple[str, str]]] # undocumented
66
python3: Literal[True]
7+
string_type = str
8+
unicode_type = str
79

810
def unicode(x: str, y: str) -> str: ...
911
def render(

stubs/colorama/@tests/stubtest_allowlist_linux.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
colorama.winterm.WinColor
33
colorama.winterm.WinStyle
44
colorama.winterm.WinTerm
5-
6-
# A re-export that's an implementation detail:
7-
colorama.winterm.get_osfhandle

stubs/decorator/@tests/stubtest_allowlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ decorator.FunctionMaker.varkw
77
decorator.decorate
88
decorator.decorator
99
decorator.get_init
10+
decorator.EMPTY

stubs/fanstatic/@tests/stubtest_allowlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ fanstatic.core.DummyNeededResources.clear
1414
fanstatic.core.DummyNeededResources.library_url
1515
fanstatic.core.DummyNeededResources.resources
1616

17+
fanstatic.compiler.mtime
18+
1719
# Error: is inconsistent
1820
# ======================
1921
# The core API for Dependable is a bit annoying, since the base class

stubs/fpdf2/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,3 @@ fpdf.fonts.HarfBuzzFont
1212
# fixed in later versions.
1313
fpdf.FPDF.set_encryption
1414
fpdf.fpdf.FPDF.set_encryption
15-
16-
# Runtime has some internal arguments.
17-
fpdf.syntax.build_obj_dict
18-
fpdf.ViewerPreferences.serialize
19-
fpdf\.[a-z]+\.[A-Za-z]+\.serialize

0 commit comments

Comments
 (0)