尝试将 pip install recordclass
(0.14.3
) 模块安装到我的 pypy3 (PyPy 7.3.4-alpha0 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)
) virtualenv 但遇到问题。有没有办法安装这个?还是该库目前不支持pypy?
错误的小片段是:
1024 | _PyUnicodeWriter_Dealloc(&writer);
| ^~~~~~~~~~~~~~~~~~~~~~~~
lib/recordclass/_dataobject.c: In function 'dataobjectiter_reduce':
lib/recordclass/_dataobject.c:2032:39: warning: implicit declaration of function '_PyObject_GetBuiltin'; did you mean 'PyObject_GetBuffer'? [-Wimplicit-function-declaration]
2032 | return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
| ^~~~~~~~~~~~~~~~~~~~
| PyObject_GetBuffer
lib/recordclass/_dataobject.c: In function 'PyInit__dataobject':
lib/recordclass/_dataobject.c:2916:9: warning: implicit declaration of function 'PyState_FindModule' [-Wimplicit-function-declaration]
2916 | m = PyState_FindModule(&dataobjectmodule);
| ^~~~~~~~~~~~~~~~~~
lib/recordclass/_dataobject.c:2916:7: warning: assignment to 'PyObject *' {aka 'struct _object *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
2916 | m = PyState_FindModule(&dataobjectmodule);
| ^
error: command 'gcc' failed with exit status 1
答案 0 :(得分:1)
我打开了一个问题 https://foss.heptapod.net/pypy/pypy/-/issues/3438。但是,如果提高性能是您的目标,那么记录类可能是 PyPy 的错误工具。它使用(无限制)C-API,这在 PyPy 上很慢。您可能最好使用命名元组。