python兼容c语言吗_CPython,IronPython和Jython脚本相互兼容吗?

I am pretty sure that python scripts will work in all three, but I want to make sure. I have read here and there about editors that can write CPython, Jython, IronPython and I am hoping that I am looking to much into the distinction.

My situation is I have 3 different api's that I want to test. Each api performs the same functionality code wise, but they are different in implementation. I am writing wrappers around each language's apis. Each wrapper should expose the exact same functionality and implementation to python using Boost::python, Jython, and IronPython.

My question is, would a python script written using these exposed methods (that are common for each language) work in all three "flavors" of Python?

Like I said I am pretty sure the answer is 'Of course,' but I need to make sure before I spend too much time working on this.

解决方案

The short answer is: Sometimes.

Some projects built on top of IronPython may not work with CPython, and some CPython modules that are written in C (e.g. NumPy) will not work with IronPython.

On a similar note, while Jython implements the language specification, it has several incompatibilities with CPython (for instance, it lacks a few parts of the CPython standard library, and it can import Java standard library packages and classes, like Swing)

So, yes, as long as you avoid the incompatibilities.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值