Simple email validation script
Interface design

The current design of the validator class is not very intuitive.
Users of this class must call the check_for_symbol and check_length methods to validate an email address.
They would only know this by reading the implementation.
You could add documentation,
but it would still not be easy to use.
The best is when the usage and behavior is obvious.

I would imagine the design of an email validator something like this:

class EmailValidator:
    def validate(self, email):
        # ...


Where the validate method would raise exceptions depending on what failed (such as length, symbols).

With such outline, even without documentation,
when a user does help(EmailValidator) and sees a single validate method,
the usage is obvious, clear.

What's worse,
the check_email function is not part of the validator class.
As such, the validator doesn't encapsulate the validation logic.
That might be acceptable if the public API is the check_email and the class is the implementation detail.

Coding style

Use boolean expressions directly. For example, instead of this:


def check_for_symbol(self):
    if re.search("[@.]", self.email) is None:
        return False
    else:
        return True



You could write as:

def check_for_symbol(self):
    return re.search("[@.]", self.email) is not None


Also, instead of x is True, use simply x, and instead of x is False, use not x.

See more on this in the style guide.

Compatibility with Python 3

When using Python 2,
to future-proof yourself it's good to adopt a writing style compatible with Python 3. For example, instead of print 'something', write print('something').