parameters: (f)
docstring: r"""
      >>> import StringIO
      >>> read_decimalnl_short(StringIO.StringIO("1234\n56"))
      1234
  
      >>> read_decimalnl_short(StringIO.StringIO("1234L\n56"))
      Traceback (most recent call last):
      ...
      ValueError: trailing 'L' not allowed in '1234L'
docstring_summary: r"""
      >>> import StringIO
      >>> read_decimalnl_short(StringIO.StringIO("1234\n56"))
      1234
docstring_tokens: r >>> import StringIO >>> read_decimalnl_short ( StringIO . StringIO ( 1234 \ n56 )) 1234
function: def read_decimalnl_short(f):
      r"""
      >>> import StringIO
      >>> read_decimalnl_short(StringIO.StringIO("1234\n56"))
      1234
  
      >>> read_decimalnl_short(StringIO.StringIO("1234L\n56"))
      Traceback (most recent call last):
      ...
      ValueError: trailing 'L' not allowed in '1234L'
      """
  
      s = read_stringnl(f, decode=False, stripquotes=False)
      if s.endswith("L"):
          raise ValueError("trailing 'L' not allowed in %r" % s)
  
      # It's not necessarily true that the result fits in a Python short int:
      # the pickle may have been written on a 64-bit box.  There's also a hack
      # for True and False here.
      if s == "00":
          return False
      elif s == "01":
          return True
  
      try:
          return int(s)
      except OverflowError:
          return long(s)
function_tokens: def read_decimalnl_short ( f ) : s = read_stringnl ( f , decode = False , stripquotes = False ) if s . endswith ( "L" ) : raise ValueError ( "trailing 'L' not allowed in %r" % s ) # It's not necessarily true that the result fits in a Python short int: # the pickle may have been written on a 64-bit box.  There's also a hack # for True and False here. if s == "00" : return False elif s == "01" : return True try : return int ( s ) except OverflowError : return long ( s )