using basestring instead of str for param typechecking, updating tests