[issue44992] functools.lru_cache does not consider strings and numpy strings as equivalent

2021-08-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the report but this is an allowed behavior and not a bug. Per the docsĀ¹: If typed is set to true, function arguments of different types will be cached separately. For example, f(3) and f(3.0) will always be treated as distinct calls with

[issue44992] functools.lru_cache does not consider strings and numpy strings as equivalent

2021-08-24 Thread Brian Lee
New submission from Brian Lee : This seems like unexpected behavior: Two keys that are equal and have equal hashes should yield cache hits, but they do not. Python 3.9.6 (default, Aug 18 2021, 19:38:01) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license"