I'm studying Python by myself and was not able to find explanation for this behavior:
When the regex object is first compiled and findall() method is used on the compiled regex object with re.I flag, the result is different than by using findall() function with the same flag by itself.
(Removing re.I flag from result variable "fixes" the dissimilarity of results.)
import re
emails1 = re.compile(r"([A-z0-9._+-]+@[A-z0-9._+-]+\.[A-z]{2,})")
result = emails1.findall("xxx@yyy.com", re.I)
print(result)
>>>['x@yyy.com']
emails2 = re.findall(r"([A-z0-9._+-]+@[A-z0-9._+-]+\.[A-z]{2,})", "xxx@yyy.com", re.I)
print(emails2)
>>>['xxx@yyy.com']
Appreciate any help or advice!