Skip to content

Commit

Permalink
Handle allow_empty_local as an Optional, like other keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
musicinmybrain committed Jun 21, 2024
1 parent f1367c1 commit f3a9f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions email_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def caching_resolver(*args, **kwargs):
# Default values for keyword arguments.

ALLOW_SMTPUTF8 = True
ALLOW_EMPTY_LOCAL = False
ALLOW_QUOTED_LOCAL = False
ALLOW_DOMAIN_LITERAL = False
ALLOW_DISPLAY_NAME = False
Expand Down
6 changes: 4 additions & 2 deletions email_validator/validate_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def validate_email(
/, # prior arguments are positional-only
*, # subsequent arguments are keyword-only
allow_smtputf8: Optional[bool] = None,
allow_empty_local: bool = False,
allow_empty_local: Optional[bool] = None,
allow_quoted_local: Optional[bool] = None,
allow_domain_literal: Optional[bool] = None,
allow_display_name: Optional[bool] = None,
Expand All @@ -34,10 +34,12 @@ def validate_email(
"""

# Fill in default values of arguments.
from . import ALLOW_SMTPUTF8, ALLOW_QUOTED_LOCAL, ALLOW_DOMAIN_LITERAL, ALLOW_DISPLAY_NAME, \
from . import ALLOW_SMTPUTF8, ALLOW_EMPTY_LOCAL, ALLOW_QUOTED_LOCAL, ALLOW_DOMAIN_LITERAL, ALLOW_DISPLAY_NAME \
GLOBALLY_DELIVERABLE, CHECK_DELIVERABILITY, TEST_ENVIRONMENT, DEFAULT_TIMEOUT
if allow_smtputf8 is None:
allow_smtputf8 = ALLOW_SMTPUTF8
if allow_empty_local is None:
allow_empty_local = ALLOW_EMPTY_LOCAL
if allow_quoted_local is None:
allow_quoted_local = ALLOW_QUOTED_LOCAL
if allow_domain_literal is None:
Expand Down

0 comments on commit f3a9f28

Please sign in to comment.