*** liboptparse.tex Sun Feb 1 12:17:18 2004 --- liboptparse.tex.orig Sun Feb 1 10:15:20 2004 *************** *** 1003,1022 **** the text on the command line is stored in the destination (or passed to the callback) as-is. ! Integer arguments (``int'', ``long'') are parsed as follows: ! \begin{itemize} ! \item If the number starts with {\tt 0x} it is parsed as a hexa-decimal number. ! \item If the number starts with {\tt 0} it is parsed as an octal number. ! \item If the number starts with {\tt 0b} is is parsed as a binary number. ! \item Otherwise the number is parsed as a decimal number. ! \end{itemize} ! The conversion to number is done by calling either \function{int()} or ! \function{long()} builtin functions with the appropriate base. If these ! functions fails , so will \module{optparse}, although with a more useful error ! message. Internally, \module{optparse} raises \exception{OptionValueError} in \function{optparse.check_builtin()}; at a higher level (in ! \class{OptionParser}), \module{optparse} catches this exception and terminates ! your program with a useful error message. Likewise, float arguments are passed to \function{float()} for conversion, long arguments to \function{long()}, and complex arguments --- 1003,1015 ---- the text on the command line is stored in the destination (or passed to the callback) as-is. ! Integer arguments are passed to \function{int()} to convert them to ! Python integers. If \function{int()} fails, so will ! \module{optparse}, although with a more useful error message. ! Internally, \module{optparse} raises \exception{OptionValueError} in \function{optparse.check_builtin()}; at a higher level (in ! \class{OptionParser}), \module{optparse} catches this exception and ! terminates your program with a useful error message. Likewise, float arguments are passed to \function{float()} for conversion, long arguments to \function{long()}, and complex arguments