>> I am trying the new C++ syntax. I got the following error (all files 
>> attached):
>>
>> $ cython _hermes_common.pyx
>> ...
>>    if len(self.attributes) != 0:
>> TypeError: object of type 'NoneType' has no len()
>>
>
> Yep, that's a bug. I'm pretty sure you just want to change that line
> in Cython/Compiler/Nodes.py from "if len(self.attributes) != 0:" to
> just "if self.attributes:" and you'll be good.
>
> Amusingly, I tried to grab the source files you attached and test this
> -- and hit a different bug (a problem in parsing). I don't know why --
> you just posted and confirmed that we're using the same version
> (before I even asked!). Is there any chance your source files are
> slightly out of sync with the ones you posted? (Maybe forgot to save
> changes in your editor before posting?) Has anyone else tried and hit
> the same bug, or is my setup wonky?
>

So I finally got a chance to sit down and look at this today. The
first bug was easy, and luckily Robert Bradshaw was sitting right next
to me for the second -- he immediately called the function where the
error was going to be, and it was just a question of spotting it. I'm
running tests right now, and I'll push as soon as those are done.

I also had to make a few changes to your .pyx and .pxd files -- mostly
little things. I'm attaching the versions I used, which now compile
just fine. (I didn't actually test them at all, not having any of the
code they're written against, just checked that they seem to be
producing sensible .cpp files.) Definitely let us know if/when you run
into more trouble -- a lot of this new C++ code just hasn't been run
through its paces, and it's good to work the little bugs out.

-cc

Attachment: _hermes_common.pxd
Description: Binary data

Attachment: _hermes_common.pyx
Description: Binary data

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to