Creating large chunks of memory is quite tricky in Python because of a number of overheads. I’ve been attempting this myself and have found a fast method to do this which combines a few handy optimisations we would need later on for a Voxel Engine anyway.
Please be aware that the code evolves along the way, so don’t blindly copy and paste the first examples =).
Also, the WordPress theme is cutting of some text. If you copy and paste it, it is still there.
This post is continued in Position Aware RLE, RLE and Part 2.