xoutil.validators.identifiers – Simple identifiers validators

Regular expressions and validation functions for several identifiers.

xoutil.validators.identifiers.is_valid_identifier(name)[source]

Returns True if name a valid Python identifier.

Note

Only Python 2’s version of valid identifier. This means that some Python 3 valid identifiers are not considered valid. This helps to keep things working the same in Python 2 and 3.

xoutil.validators.identifiers.is_valid_full_identifier(name)[source]

Returns True if name is a valid dotted Python identifier.

See is_valid_identifier() for what “validity” means.

xoutil.validators.identifiers.is_valid_public_identifier(name)[source]

Returns True if name is a valid Python identifier that is deemed public.

Convention says that any name starting with a “_” is not public.

See is_valid_identifier() for what “validity” means.