@staticmethod
def str_to_int(string):
    """ Convert a string or an integer to a `(string, integer)` couple.

        Returns together the original string and its integer representation if
        convertion is successful and lossless. Else returns the original string
        and `None`."""
    try:
        integer = int(string)
    except ValueError:
        return str(string), None
    string = str(string)
    str_int = string.lstrip('0')
    if not str_int:
        str_int = '0'
    if str(integer) != str_int:
        raise TypeError('{!r} string is not equivalent to {!r} integer'.
            format(string, integer))
    return string, integer
