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

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.

Like what you read? Give Tom Ritchford a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.