(msg=None)
return fn
Checks whether a value is:
        - int, or
        - long, or
        - float without a fractional part, or
        - str or unicode composed only of digits
Checks whether a value is:
        - int, or
        - long, or
        - float without a fractional part, or
        - str or unicode composed only of digits
Checks whether a value is : - int or - long or - float without a fractional part or - str or unicode composed only of digits
def IntegerLike(msg=None):
    '''
    Checks whether a value is:
        - int, or
        - long, or
        - float without a fractional part, or
        - str or unicode composed only of digits
    '''
    def fn(value):
        if not any([
            isinstance(value, numbers.Integral),
            (isinstance(value, float) and value.is_integer()),
            (isinstance(value, basestring) and value.isdigit())
        ]):
            raise Invalid(msg or (
                'Invalid input <{0}>; expected an integer'.format(value))
            )
        else:
            return value
    return fn
def IntegerLike ( msg = None ) : def fn ( value ) : if not any ( [ isinstance ( value , numbers . Integral ) , ( isinstance ( value , float ) and value . is_integer ( ) ) , ( isinstance ( value , basestring ) and value . isdigit ( ) ) ] ) : raise Invalid ( msg or ( 'Invalid input <{0}>; expected an integer' . format ( value ) ) ) else : return value return fn