Idea how to clean up the parameter list of validate_email[_or_fail] #56
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: karolyi/py3-validate-email#56
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With the growing number of checks that can be switched on and off, the parameter list has become somewhat long and cluttered, switches are named
use_*
,check_*
, orskip_*
, and also some have to be set toTrue
to enable a test, some toTrue
to disable the test.I had the idea of replacing all these parameters with a single one:
First, we define a constant for each of the possible checks:
and we define the default set of checks as a Python
set
:Then, we can change
validate_email_or_fail
to accept the parameterchecks: Set = CHECK_DEFAULT
.Downside: this would either break compatibility with previous versions, or we'd have to accept both options for a while, adding a deprecation warning when the old parameters are used.
What do you think?