There is a LRU cache in the standard library starting in 3.2: https://docs.python.org/3/library/functools.html#functools.l... Doesn't have quite the same options, but arguably nicer to use because it's a decorator.
You're right - good point. For one way, I guess you could let p_i represent the ith prime number (there are infinitely many) and use p_x / p_y instead. Unsure about the other way.
If the pixels are laid out in a grid then each has a coordinate (x, y), where x and y are integers. Then we form a bijection (x, y) <-> x/y and we see that there are as many pixels as rational numbers. We know that the…
There is a LRU cache in the standard library starting in 3.2: https://docs.python.org/3/library/functools.html#functools.l... Doesn't have quite the same options, but arguably nicer to use because it's a decorator.
You're right - good point. For one way, I guess you could let p_i represent the ith prime number (there are infinitely many) and use p_x / p_y instead. Unsure about the other way.
If the pixels are laid out in a grid then each has a coordinate (x, y), where x and y are integers. Then we form a bijection (x, y) <-> x/y and we see that there are as many pixels as rational numbers. We know that the…