(self, number)
return number
Validate the given 1-based page number.
Validate the given 1-based page number.
Validate the given 1 - based page number .
def validate_number(self, number):
        """Validate the given 1-based page number."""
        try:
            if isinstance(number, float) and not number.is_integer():
                raise ValueError
            number = int(number)
        except (TypeError, ValueError):
            raise PageNotAnInteger(_("That page number is not an integer"))
        if number < 1:
            raise EmptyPage(_("That page number is less than 1"))
        return number
def validate_number ( self , number ) : try : if isinstance ( number , float ) and not number . is_integer ( ) : raise ValueError number = int ( number ) except ( TypeError , ValueError ) : raise PageNotAnInteger ( _ ( "That page number is not an integer" ) ) if number < 1 : raise EmptyPage ( _ ( "That page number is less than 1" ) ) return number