Add test case for recent types-regex regression (#9269)

This commit is contained in:
Alex Waygood
2022-11-24 19:37:12 +00:00
committed by GitHub
parent 89f22278ba
commit b3728f38f5

View File

@@ -0,0 +1,13 @@
# pyright: reportUnnecessaryTypeIgnoreComment=true
from __future__ import annotations
from typing import List
from typing_extensions import assert_type
import regex
# Regression tests for #9263
assert_type(list(regex.finditer(r"foo", "foo")), List[regex.Match[str]])
pat = regex.compile(rb"foo")
assert_type(list(pat.finditer(b"foo")), List[regex.Match[bytes]])