mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Buffer support for re (#7679)
This commit is contained in:
8
test_cases/stdlib/typing/pattern.py
Normal file
8
test_cases/stdlib/typing/pattern.py
Normal 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]])
|
||||
Reference in New Issue
Block a user