This module defines an object type which can compactly represent an array of basic values: characters, integers, floating point numbers ... The type is specified at object creation time by using a type code
仅支持的类型如下(注意没有list):
Type code C Type Python Type
'b' signed char int
'B' unsigned char int
'u' Py_UNICODE Unicode character
'h' signed short int
'H' unsigned short int
'i' signed int int
'I' unsigned int int
'l' signed long int
'L' unsigned long int
'q' signed long long int
'Q' unsigned long long int
'f' float float
'd' double float
你的要求是不可能的。来自the ^{} docs :
仅支持的类型如下(注意没有
list
):似乎您可能混淆了
array
模块与numpy
数组的本机实现。情况并非如此。在相关问题 更多 >
编程相关推荐