I\'m working with Python and whenever I\'ve had to validate function input, I assumed that the input worked, and then caught errors.
In my case, I had a universal
In Python, exceptions are often faster due to the reduced number of lookups. However a friend once said (and it should apply to any language), pretend that everytime an exception is caught, there is a small delay. Avoid using exceptions where a delay could be a problem.
In the example you've given, I'd go with the exception.