import regex
from regex import Scanner
text = " yep "
pattern = regex.compile(r"yep")
matches = pattern.finditer(text)
def print_matches(matches:Scanner[str]):
for match in matches:
print(match)
print_matches(matches)
Im trying to add type annotation to my print_matches() function, but i get an error in zed
````"Scanner[str]" is not iterable "iter" method not defined (Pyright reportGeneralTypeIssues)```
How do i fix this, and what is causing the problem?
I also get an error when i run this:
~~~~~~~^^^^^
TypeError: type 'Scanner' is not subscriptable```