Mercurial > cpython-lru_cache-weakref
comparison Doc/libarray.tex @ 7712:0cbc9df882b6 legacy-trunk
Change "\," to just "," in function signatures. This is easier to maintain,
works better with LaTeX2HTML, and allows some simplification of the python.sty
macros.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Tue, 17 Mar 1998 06:33:25 +0000 |
| parents | ef980e17b593 |
| children | 6d04e8c817fb |
comparison
equal
deleted
inserted
replaced
| 7711:56dcfc27710a | 7712:0cbc9df882b6 |
|---|---|
| 33 | 33 |
| 34 See also built-in module \module{struct}\refbimodindex{struct}. | 34 See also built-in module \module{struct}\refbimodindex{struct}. |
| 35 | 35 |
| 36 The module defines the following function: | 36 The module defines the following function: |
| 37 | 37 |
| 38 \begin{funcdesc}{array}{typecode\optional{\, initializer}} | 38 \begin{funcdesc}{array}{typecode\optional{, initializer}} |
| 39 Return a new array whose items are restricted by \var{typecode}, and | 39 Return a new array whose items are restricted by \var{typecode}, and |
| 40 initialized from the optional \var{initializer} value, which must be a | 40 initialized from the optional \var{initializer} value, which must be a |
| 41 list or a string. The list or string is passed to the new array's | 41 list or a string. The list or string is passed to the new array's |
| 42 \method{fromlist()} or \method{fromstring()} method (see below) to add | 42 \method{fromlist()} or \method{fromstring()} method (see below) to add |
| 43 initial items to the array. | 43 initial items to the array. |
| 75 ``Byteswap'' all items of the array. This is only supported for | 75 ``Byteswap'' all items of the array. This is only supported for |
| 76 integer values. It is useful when reading data from a file written | 76 integer values. It is useful when reading data from a file written |
| 77 on a machine with a different byte order. | 77 on a machine with a different byte order. |
| 78 \end{funcdesc} | 78 \end{funcdesc} |
| 79 | 79 |
| 80 \begin{funcdesc}{fromfile}{f\, n} | 80 \begin{funcdesc}{fromfile}{f, n} |
| 81 Read \var{n} items (as machine values) from the file object \var{f} | 81 Read \var{n} items (as machine values) from the file object \var{f} |
| 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 |
| 96 Appends items from the string, interpreting the string as an | 96 Appends items from the string, interpreting the string as an |
| 97 array of machine values (i.e. as if it had been read from a | 97 array of machine values (i.e. as if it had been read from a |
| 98 file using the \method{fromfile()} method). | 98 file using the \method{fromfile()} method). |
| 99 \end{funcdesc} | 99 \end{funcdesc} |
| 100 | 100 |
| 101 \begin{funcdesc}{insert}{i\, x} | 101 \begin{funcdesc}{insert}{i, x} |
| 102 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 |
| 103 \var{i}. | 103 \var{i}. |
| 104 \end{funcdesc} | 104 \end{funcdesc} |
| 105 | 105 |
| 106 \begin{funcdesc}{read}{f\, n} | 106 \begin{funcdesc}{read}{f, n} |
| 107 \deprecated {1.5.1} | 107 \deprecated {1.5.1} |
| 108 {Use the \method{fromfile()} method.} | 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 |
