How to determine if a python str is alphanumeric?