It might be a good idea to put this check in the __init__ method itself, so that the error gets detected as early as possible.