Skip to content

Commit da6506e

Browse files
committed
Fix typing for _SupportsRead
1 parent c8823d1 commit da6506e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Changelog
22

3-
**Unreleased**
3+
**1.7.0 (2025-10-02)**
44

55
* Update for Python 3.14 and require at least 3.8 (by Edgar Ramírez, [#112](https://github.com/Kijewski/pyjson5/pull/112))
6+
* Update to Unicode 17.0.0 ([#117](https://github.com/Kijewski/pyjson5/pull/117))
7+
* Fix typing for `_SupportsRead` ([#118](https://github.com/Kijewski/pyjson5/pull/118))
68

79
**1.6.9 (2025-05-12)**
810

src/pyjson5/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ from typing import (
1313
Union,
1414
)
1515

16-
_Data = TypeVar("_Data")
16+
_Data = TypeVar("_Data", contravariant=True)
1717

1818
class _SupportsRead(Protocol):
19-
def read(self, size: int = ...) -> str: ...
19+
def read(self, size: int | None = ...) -> str | bytes: ...
2020

2121
class _SupportsWrite(Protocol[_Data]):
2222
def write(self, s: _Data) -> Any: ...

0 commit comments

Comments
 (0)