You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's strange. Assuming you're using --py2 mode (there's no overload in the Python 3 stub for re.pyi). The stdlib/2.7/re.pyi hasn't changed since your change 21c90d5 in January. It looks like the spec for sub() is wrong, it doesn't allow Pattern[AnyStr] for the pattern arg. I'm guessing that some bug in overload checking was fixed that surfaced this. The stub needs to be fixed.
Oh, I think one of my changes made it so that type variables with value restriction in overloads would only match types that are a subtype of the union of the possible values of the type variable. So Pattern[str] no longer matches Union[str, unicode]. Not sure why the statement type checked in the first place, maybe #1322?
On upgrading to mypy 0.4 I get this new error:
when using a compiled regular expression:
Haven't had a chance to investigate whether this is caused be a change in typeshed or mypy itself.
The text was updated successfully, but these errors were encountered: