Skip navigation

That Python Is Strangling Me!

I’ve given up on implementing Python classes using C API since I couldn’t get instancing in the C API to work properly. No helpfull error messages, either segfault or “wrong arguments in Objects\classobjects.cpp line 504″, no helpfull documentation, and me to tired to even type gdb. I’m going back to write a simple module and wrap it in classes written in Python.

But that solutions annoy me because it will mean I first write a module, transfering my C++ interfaces to something similar to a C interface (object-oriented non the less in a GTK+ way), and then wrap that module into Python classes miming the original interfaces. I had hope to shorten that path. But apparently failed to do so. Oh well, oh well… There’s another day tomorrow, said Scarlett O’Hara before she logged of.

And Now Something Completely Different …

I finally figured out how to implement classes in Python using C API — the right way. Namely as a new type using the PyTypeObject complete with get and set attribute calls and plain members. But I tought my previous hack for building a class at runtime is still slim enough to share, especially if you just got a couple of methods that you want bundled into a class instead of a module.

Read the full story

A Singleton Not Named Bridget

Ok. I haven’t posted anything in a (relative) long time. To tell the truth — there isn’t much to report.

Read the full story

Creeper