On this page
array.ArrayType
Prev: array.array | Up: array
Rel: array.array
Ref: docs.python.org — array.ArrayType
Tags: #public #python3 #stdlib #array
Import
import array
from array import ArrayType
Signature & Overview
array.ArrayType(...)
Return a new array whose items are restricted by typecode, and initialized from the optional initializer value, which must be a list, string or iterable over elements of the appropriate type.
Methods & Attributes
ArrayType.append(self, v, /)— Append new value v to the end of the array.ArrayType.buffer_info(self, /)— Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array's contents.ArrayType.byteswap(self, /)— Byteswap all items of the array.ArrayType.clear(self, /)— Remove all items from the array.ArrayType.count(self, v, /)— Return number of occurrences of v in the array.ArrayType.extend(self, bb, /)— Append items to the end of the array.ArrayType.frombytes(self, buffer, /)— Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method.ArrayType.fromfile(self, f, n, /)— Read n objects from the file object f and append them to the end of the array.ArrayType.fromlist(self, list, /)— Append items to array from list.ArrayType.fromunicode(self, ustr, /)— Extends this array with data from the unicode string ustr.ArrayType.index(self, v, start=0, stop=9223372036854775807, /)— Return index of first occurrence of v in the array.ArrayType.insert(self, i, v, /)— Insert a new item v into the array before position i.ArrayType.pop(self, i=-1, /)— Return the i-th element and delete it from the array.ArrayType.remove(self, v, /)— Remove the first occurrence of v in the array.ArrayType.reverse(self, /)— Reverse the order of the items in the array.ArrayType.tobytes(self, /)— Convert the array to an array of machine values and return the bytes representation.ArrayType.tofile(self, f, /)— Write all items (as machine values) to the file object f.ArrayType.tolist(self, /)— Convert array to an ordinary list with the same items.ArrayType.tounicode(self, /)— Extends this array with data from the unicode string ustr.
Usage
import array
assert array.ArrayType is array.array
Gotchas
- Legacy alias for
array.array: Usearray.arraydirectly.
REPL Inspect
from array import ArrayType
help(ArrayType)
Linked from
Related notes
- tuts/python3/stdlib_module/array/array Linked here; links to this page; shared tags: #array, #stdlib
- tuts/python3/stdlib_module/array links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib
- tuts/c/stdlib/ctype/isspace shared tags: #stdlib