Join GitHub today
doctest for method_cache fails on Python 3.7.3 #12
I just cannot wrap my head around it. Given the method
the very same
It should only return 75 because
Oh, you're right. That's a bug. The tests passed on Python 3.7.1 (and I'm pretty sure 3.7.2 also). It seems something changed between Python 3.7.2 and 3.7.3 that breaks this implementation.
What this is trying to say is that
Then, when you do
The cache found on
If you then instantiate
The first 25 calls add to the cache on
But now the cache is full. It has 100 items in it. So calling
There's no longer an entry for
It's not that
I see the following entry in the Python 3.7.3 news:
Those changes (traced to here) are likely implicated.
Thanks, that is my mistake obviously. I kind of forgot that this package actually does something useful ;).
My first instinct was that this was a serious flaw with serious performance consequences for this library (cache not having an effect). After Raymond's analysis, I see now it only causes a single cache miss on the first call (an artifact of the cache being created). The long-term performance should be unaffected. Therefore, the only remedy needed here is to bypass the test failure.