Here’s the converted function
Programming Pearls and Python Fails
Franklin He
604

I’m curious to see whether if you used the STL for this then you would do better yet again.

Here’s code from my working Cython project — not really much to it (there’s a lot more elsewhere gluing such functions into Cython of course).

It seems to run fine, and others have reported that std::rotate seems to work quite well. The GCC source code for std::rotate is also intriguing, though I cannot say I have fully understood how it works.

A single golf clap? Or a long standing ovation?

By clapping more or less, you can signal to us which stories really stand out.