Buffer support for re (#7679)

This commit is contained in:
Jelle Zijlstra
2022-04-23 18:28:35 -07:00
committed by GitHub
parent 5dad506bf2
commit 02e0c98d62
3 changed files with 86 additions and 48 deletions

View File

@@ -0,0 +1,8 @@
from typing import Match, Optional, Pattern
from typing_extensions import assert_type
def test_search(str_pat: Pattern[str], bytes_pat: Pattern[bytes]) -> None:
assert_type(str_pat.search("x"), Optional[Match[str]])
assert_type(bytes_pat.search(b"x"), Optional[Match[bytes]])
assert_type(bytes_pat.search(bytearray(b"x")), Optional[Match[bytes]])