Mercurial > cpython-lru_cache-weakref
comparison Doc/libarray.tex @ 7505:ef980e17b593 legacy-trunk
Deprecate the read() and write() methods.
Don't refer to them from the fromfile() and tofile() methods.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Fri, 27 Feb 1998 16:21:31 +0000 |
| parents | d17db3ebfbc2 |
| children | 0cbc9df882b6 |
comparison
equal
deleted
inserted
replaced
| 7504:894cffeb89ba | 7505:ef980e17b593 |
|---|---|
| 82 and append them to the end of the array. If less than \var{n} items | 82 and append them to the end of the array. If less than \var{n} items |
| 83 are available, \exception{EOFError} is raised, but the items that were | 83 are available, \exception{EOFError} is raised, but the items that were |
| 84 available are still inserted into the array. \var{f} must be a real | 84 available are still inserted into the array. \var{f} must be a real |
| 85 built-in file object; something else with a \code{read()} method won't | 85 built-in file object; something else with a \code{read()} method won't |
| 86 do. | 86 do. |
| 87 | |
| 88 Also available as the \method{read()} method. | |
| 89 \end{funcdesc} | 87 \end{funcdesc} |
| 90 | 88 |
| 91 \begin{funcdesc}{fromlist}{list} | 89 \begin{funcdesc}{fromlist}{list} |
| 92 Append items from the list. This is equivalent to | 90 Append items from the list. This is equivalent to |
| 93 \samp{for x in \var{list}:\ a.append(x)} | 91 \samp{for x in \var{list}:\ a.append(x)} |
| 104 Insert a new item with value \var{x} in the array before position | 102 Insert a new item with value \var{x} in the array before position |
| 105 \var{i}. | 103 \var{i}. |
| 106 \end{funcdesc} | 104 \end{funcdesc} |
| 107 | 105 |
| 108 \begin{funcdesc}{read}{f\, n} | 106 \begin{funcdesc}{read}{f\, n} |
| 107 \deprecated {1.5.1} | |
| 108 {Use the \method{fromfile()} method.} | |
| 109 Read \var{n} items (as machine values) from the file object \var{f} | 109 Read \var{n} items (as machine values) from the file object \var{f} |
| 110 and append them to the end of the array. If less than \var{n} items | 110 and append them to the end of the array. If less than \var{n} items |
| 111 are available, \exception{EOFError} is raised, but the items that were | 111 are available, \exception{EOFError} is raised, but the items that were |
| 112 available are still inserted into the array. \var{f} must be a real | 112 available are still inserted into the array. \var{f} must be a real |
| 113 built-in file object; something else with a \method{read()} method won't | 113 built-in file object; something else with a \method{read()} method won't |
| 114 do. | 114 do. |
| 115 | |
| 116 Also available as the \method{fromfile()} method. | |
| 117 \end{funcdesc} | 115 \end{funcdesc} |
| 118 | 116 |
| 119 \begin{funcdesc}{reverse}{} | 117 \begin{funcdesc}{reverse}{} |
| 120 Reverse the order of the items in the array. | 118 Reverse the order of the items in the array. |
| 121 \end{funcdesc} | 119 \end{funcdesc} |
| 122 | 120 |
| 123 \begin{funcdesc}{tofile}{f} | 121 \begin{funcdesc}{tofile}{f} |
| 124 Write all items (as machine values) to the file object \var{f}. | 122 Write all items (as machine values) to the file object \var{f}. |
| 125 | |
| 126 Also available as the \function{write()} function. | |
| 127 \end{funcdesc} | 123 \end{funcdesc} |
| 128 | 124 |
| 129 \begin{funcdesc}{tolist}{} | 125 \begin{funcdesc}{tolist}{} |
| 130 Convert the array to an ordinary list with the same items. | 126 Convert the array to an ordinary list with the same items. |
| 131 \end{funcdesc} | 127 \end{funcdesc} |
| 135 string representation (the same sequence of bytes that would | 131 string representation (the same sequence of bytes that would |
| 136 be written to a file by the \method{tofile()} method.) | 132 be written to a file by the \method{tofile()} method.) |
| 137 \end{funcdesc} | 133 \end{funcdesc} |
| 138 | 134 |
| 139 \begin{funcdesc}{write}{f} | 135 \begin{funcdesc}{write}{f} |
| 136 \deprecated {1.5.1} | |
| 137 {Use the \method{tofile()} method.} | |
| 140 Write all items (as machine values) to the file object \var{f}. | 138 Write all items (as machine values) to the file object \var{f}. |
| 141 | |
| 142 Also available as the \function{write()} function. | |
| 143 \end{funcdesc} | 139 \end{funcdesc} |
| 144 | 140 |
| 145 When an array object is printed or converted to a string, it is | 141 When an array object is printed or converted to a string, it is |
| 146 represented as \code{array(\var{typecode}, \var{initializer})}. The | 142 represented as \code{array(\var{typecode}, \var{initializer})}. The |
| 147 \var{initializer} is omitted if the array is empty, otherwise it is a | 143 \var{initializer} is omitted if the array is empty, otherwise it is a |
