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
The `EmailValidator` validates email addresses as strings and returns them unmodified.
230
230
231
-
Please note that this validator is a bit opinionated and simplified in that it does **not** allow every email address that technically
232
-
is valid according to the RFCs. For example, it does neither allow internationalized email addresses (although this might be changed
233
-
in the future), nor oddities like quoted strings as local part or comments, because most mail software does not support those anyway
234
-
and/or might break with those adresses.
231
+
Please note that this validator is a bit opinionated and simplified in that it does **not** allow every email address
232
+
that technically is valid according to the RFCs. For example, it does neither allow internationalized email addresses
233
+
(although this might be changed in the future), nor oddities like quoted strings as local part or comments, because most
234
+
mail software does not support those anyway and/or might break with those adresses.
235
235
236
-
Currently this validator has parameter `allow_empty`. To allow empty strings as input, you can set the `allow_empty` parameter to `True` (defaults to `False`).
236
+
By default, the validator does not accept empty strings as input. To allow them, set the parameter `allow_empty=True`.
237
+
238
+
Also, the default maximum string length is set to 256 characters (which would be a really long, but still valid email
239
+
address), which can be changed using the `max_length` parameter.
237
240
238
241
**Example:**
239
242
240
243
```python
241
244
from validataclass.validators import EmailValidator
0 commit comments