Yep, that's what I thought as well and was curious to see the link between the author being a rubyist and contributing to python. Too bad it wasn't any such thing.
On the plus side tho', I thought the principles mentioned go beyond the specifics of the code snippent which was being used more like an example.
The author being a rubyist has no influence to anything mentioned in the article AFAICT.
It would be really good if the author actually linked to somewhere where you can reproduce the benchmark. Either way, I'm pretty sure the correct response is "use pypy", not that I can check it
The "rubyist" is completely irrelevant to the article. The optimizations might apply as well in any number of languages, because they all are related to minimizing heap allocations and keeping the execution pipeline lean (e.g. by minimizing function calls).
It's fairly easy to think from the title that the article is going to be something about how clever the rubyist is compared to Python programmers or how slow Python is or some such, as an intrinsic property of "rubyists" or Python.
This is an assignment from Georgia Tech’s OMSCS 6601 class, Intro to AI. This was a super fun assignment, with lots of low hanging optimizations like this :)
A Rubyist? Ruby is a nice language but because of its core design flaw of metaprogramming there's no point in trying to squeeze optimizations out of Ruby code. It's slow by design.
Turns out it was a specific chunk of python snippet that
> determining all possible moves for a Queen piece on a chess-like board