yglukhov / nimpy

Nim - Python bridge
MIT License
1.47k stars 61 forks source link

Nim 2.0 compatibility #285

Closed Cloudperry closed 1 year ago

Cloudperry commented 1 year ago

Is Nimpy supposed to be compatible with Nim 2.0? I tried using Nimpy with the latest Nim 2.0 git version from choosenim.

Just importing Nimpy causes an error like this:

Hint: used config file '/home/roni/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/roni/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]
......................................................................................................................................
/home/roni/.nimble/pkgs/nimpy-#head/nimpy/py_utils.nim(150, 31) Error: type mismatch: got <PPyObject, PPyObject, typeof(nil)>
but expected one of:
proc (callable_object: PPyObject, args: PPyObject, kw: PPyObject): PPyObject{.cdecl, gcsafe.}

Edit: It is working with Nim 1.6.14.

yglukhov commented 1 year ago

Just tried with latest nim devel, and don't see any problems.

Cloudperry commented 1 year ago

It seems this was some weird bug caused by having very old Choosenim and Nimble directories full of stuff. It went away after removing them and clean installing Nim.