cython lambda1 vs. <lambda>

谁说我不能喝 提交于 2019-12-22 09:57:41

问题


I have found out that on my PC, a certain method is represented as <cyfunction <lambda> at 0x06DD02A0>, while on a CentOS server, it's <cyfunction lambda1 at 0x1df3050>. I believe this is the cause for a very obscure downstream error with a different package.

Why is it different? What is its meaning? Can I turn one to the other?

Details: I see this when looking at pandas.algos._return_false. Both PC and server has python 2.7.6, same version of pandas (0.14.1), and cython 0.20.2. The PC is running Win 7, server is CentOS 6.5.


回答1:


Pandas ship with their Cython files precompiled against Cython 0.17.2. The <lambda> variant is newer than that, so was probably compiled against the system's Cython version.

You should probably avoid depending on this. It's not even consistent! Errors, for example, tend to use the lambdaN form even on Cython 0.20.2!

If you have to depend on this, standardise on a version: either use Pandas' precompiled sources everywhere or compile them yourself everywhere.

In order to compile Pandas with the system Python, run python setup.py clean to remove the prebuilt .c files.



来源:https://stackoverflow.com/questions/25704505/cython-lambda1-vs-lambda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!