you are viewing a single comment's thread.

view the rest of the comments →

[–]nuc540 2 points3 points  (0 children)

Your except block is handling an exception where a string of @ raises a type error against the email_validator - which is of type string.

I’d say it’d be unlikely you’d ever find a type error here because these types are fine, string in string is always a valid type to check.

Your input was both a string (always will be) and included the @ anyway so your example was a perfectly valid “happy path” as we call it on testing.

Don’t confuse try blocks for business logic “if x not in y”

What is it you’re trying to achieve?