栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Cython和deepcopy()在引用的方法/功能方面陷入困境。还有其他想法吗?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Cython和deepcopy()在引用的方法/功能方面陷入困境。还有其他想法吗?

嗯,终于找到了“回答自己的问题”按钮。

我可能没有耐心,但是由于没有人答复(我的意思是谁在使用Cython并在星期四下午回答问题),所以我认为我将关闭此程序。

1) Cython doesn’t like deepcopy on Classes which have function/method
referenced variables. Those variable copies will fail. From what I can tell,
there’s no working around it, you just have to come up with an new design that
doesn’t require them. I ended up doing so with the same pre above, and in my
project.


2) Cython doesn’t handle the property decorators at all. You can’t

@property

and
@<property name>.setter
. Properties need to be set the old fashion way.
e.g.
<property name> = property(get_property, set_property)
.

3) An inherited non-Cython class’s methods “might” not be accessible. I know
this vague. I can’t completely explain it. All I’ll say is I was inheriting

NetworkX.DiGraph
, and
number_of_nodes()
was no accessible after Cython,
when it was straight Python. I had to create a reference to the method and use
it. e.g.
number_of_verts = NetworkX.DiGraph.number_of_nodes
.



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/646901.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号