Skip to content

Narrow RegexValidator.regex instance level type to Pattern[str] #2650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 changes: 1 addition & 1 deletion django-stubs/core/validators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _Regex: TypeAlias = str | Pattern[str]
_ValidatorCallable: TypeAlias = Callable[[Any], None] # noqa: PYI047

class RegexValidator(_Deconstructible):
regex: _Regex # Pattern[str] on instance, but may be str on class definition
regex: Pattern[str]
message: _StrOrPromise
code: str
inverse_match: bool
Expand Down
Loading