[issue42799] Please document fnmatch LRU cache size (256) and suggest alternatives

Raymond Hettinger report at bugs.python.org
Thu Dec 31 20:56:16 EST 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

In addition to documenting the cache size, consider a substantial increase to the limit.   Compiled regex patterns tend to be very small.  We can afford to have a lot of them (tens of thousands seems reasonable to me).

Regarding the suggested alternative, ISTM that calling translate() directly doesn't help much.  For a cache miss, the overhead of the lru_cache() is very small relative to the work done by translate().

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42799>
_______________________________________


More information about the Python-bugs-list mailing list