Cython Trouble

Here are a couple of things I experienced using Cython to wrap my C++ library grakopp: Assignment and Coercion I couldn’t find a nice way to wrap boost::variant. Although the direct approach works, an assignment to the variant requires an unsafe cast, but that also adds the overhead of a copy. To work around this, I used accessor functions (requires changing the C++ implementation). The operator= is not supported to declare custom assignment functions.

Read More…

Documenting Interfaces in Python

Programs are written for humans as well as for computers, and never the twain shall meet. On the one hand, we are not smart enough to understand executables the way computers do: Programmers are notoriously bad at predicting the performance of their work as it is interpreted by actual machines, and much time is expended in chasing down bugs that result from an insufficient mental model of the machine in the programmer’s head.

Read More…

All Posts by Category or Tags.