Message 175037 - Python tracker
Maybe lru_cache() should have a key argument so you can specify a specialized key function. So you might have
def _compile_key(args, kwds, typed):
return args
@functools.lru_cache(maxsize=500, key=_compile_key)
def _compile(pattern, flags):
...