File indexing completed on 2024-04-28 15:53:57
0001 # AUTO-GENERATED FILE -- DO NOT EDIT 0002 0003 """ This module defines an object type which can efficiently represent 0004 an array of basic values: characters, integers, floating point 0005 numbers. Arrays are sequence types and behave very much like lists, 0006 except that the type of objects stored in them is constrained. The 0007 type is specified at object creation time by using a type code, which 0008 is a single character. The following type codes are defined: 0009 0010 Type code C Type Minimum size in bytes 0011 'c' character 1 0012 'b' signed integer 1 0013 'B' unsigned integer 1 0014 'u' Unicode character 2 0015 'h' signed integer 2 0016 'H' unsigned integer 2 0017 'i' signed integer 2 0018 'I' unsigned integer 2 0019 'l' signed integer 4 0020 'L' unsigned integer 4 0021 'f' floating point 4 0022 'd' floating point 8 0023 0024 The constructor is: 0025 0026 array(typecode [, initializer]) -- create a new array 0027 """ 0028 0029 ArrayType = array 0030 __package__ = None 0031 0032 class array(object): 0033 """ array(typecode [, initializer]) -> array 0034 0035 Return a new array whose items are restricted by typecode, and 0036 initialized from the optional initializer value, which must be a list, 0037 string. or iterable over elements of the appropriate type. 0038 0039 Arrays represent basic values and behave very much like lists, except 0040 the type of objects stored in them is constrained. 0041 0042 Methods: 0043 0044 append() -- append a new item to the end of the array 0045 buffer_info() -- return information giving the current memory info 0046 byteswap() -- byteswap all the items of the array 0047 count() -- return number of occurrences of an object 0048 extend() -- extend array by appending multiple elements from an iterable 0049 fromfile() -- read items from a file object 0050 fromlist() -- append items from the list 0051 fromstring() -- append items from the string 0052 index() -- return index of first occurrence of an object 0053 insert() -- insert a new item into the array at a provided position 0054 pop() -- remove and return item (default last) 0055 read() -- DEPRECATED, use fromfile() 0056 remove() -- remove first occurrence of an object 0057 reverse() -- reverse the order of the items in the array 0058 tofile() -- write all items to a file object 0059 tolist() -- return the array converted to an ordinary list 0060 tostring() -- return the array converted to a string 0061 write() -- DEPRECATED, use tofile() 0062 0063 Attributes: 0064 0065 typecode -- the typecode character used to create the array 0066 itemsize -- the length in bytes of one array item 0067 """ 0068 0069 def append(self, x): 0070 """ append(x) 0071 0072 Append new value x to the end of the array. """ 0073 pass 0074 0075 def buffer_info(self): 0076 """ buffer_info() -> (address, length) 0077 0078 Return a tuple (address, length) giving the current memory address and 0079 the length in items of the buffer used to hold array's contents 0080 The length should be multiplied by the itemsize attribute to calculate 0081 the buffer length in bytes. """ 0082 return (None, None) 0083 0084 def byteswap(self): 0085 """ byteswap() 0086 0087 Byteswap all items of the array. If the items in the array are not 1, 2, 0088 4, or 8 bytes in size, RuntimeError is raised. """ 0089 pass 0090 0091 def count(self, x): 0092 """ count(x) 0093 0094 Return number of occurrences of x in the array. """ 0095 pass 0096 0097 def extend(self, arg0): 0098 """ extend(array or iterable) 0099 0100 Append items to the end of the array. """ 0101 pass 0102 0103 def fromfile(self, f, n): 0104 """ fromfile(f, n) 0105 0106 Read n objects from the file object f and append them to the end of the 0107 array. Also called as read. """ 0108 pass 0109 0110 def fromlist(self, list): 0111 """ fromlist(list) 0112 0113 Append items to array from list. """ 0114 pass 0115 0116 def fromstring(self, string): 0117 """ fromstring(string) 0118 0119 Appends items from the string, interpreting it as an array of machine 0120 values,as if it had been read from a file using the fromfile() method). """ 0121 pass 0122 0123 def fromunicode(self, ustr): 0124 """ fromunicode(ustr) 0125 0126 Extends this array with data from the unicode string ustr. 0127 The array must be a type 'u' array; otherwise a ValueError 0128 is raised. Use array.fromstring(ustr.decode(...)) to 0129 append Unicode data to an array of some other type. """ 0130 pass 0131 0132 def index(self, x): 0133 """ index(x) 0134 0135 Return index of first occurrence of x in the array. """ 0136 pass 0137 0138 def insert(self, i, x): 0139 """ insert(i,x) 0140 0141 Insert a new item x into the array before position i. """ 0142 pass 0143 0144 itemsize = property(None, None, None, 0145 """ the size, in bytes, of one array item """ 0146 ) 0147 0148 0149 def pop(self, i=None): 0150 """ pop([i]) 0151 0152 Return the i-th element and delete it from the array. i defaults to -1. """ 0153 pass 0154 0155 def read(self, f, n): 0156 """ fromfile(f, n) 0157 0158 Read n objects from the file object f and append them to the end of the 0159 array. Also called as read. """ 0160 pass 0161 0162 def remove(self, x): 0163 """ remove(x) 0164 0165 Remove the first occurrence of x in the array. """ 0166 pass 0167 0168 def reverse(self): 0169 """ reverse() 0170 0171 Reverse the order of the items in the array. """ 0172 pass 0173 0174 def tofile(self, f): 0175 """ tofile(f) 0176 0177 Write all items (as machine values) to the file object f. Also called as 0178 write. """ 0179 pass 0180 0181 def tolist(self): 0182 """ tolist() -> list 0183 0184 Convert array to an ordinary list with the same items. """ 0185 return [] 0186 0187 def tostring(self): 0188 """ tostring() -> string 0189 0190 Convert the array to an array of machine values and return the string 0191 representation. """ 0192 return "" 0193 0194 def tounicode(self): 0195 """ tounicode() -> unicode 0196 0197 Convert the array to a unicode string. The array must be 0198 a type 'u' array; otherwise a ValueError is raised. Use 0199 array.tostring().decode() to obtain a unicode string from 0200 an array of some other type. """ 0201 return None 0202 0203 typecode = property(None, None, None, 0204 """ the typecode character used to create the array """ 0205 ) 0206 0207 0208 def write(self, f): 0209 """ tofile(f) 0210 0211 Write all items (as machine values) to the file object f. Also called as 0212 write. """ 0213 pass 0214