[issue28991] Fix obscure lru_cache reentrancy bug

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +834 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5ec5bfcf0089 by Raymond Hettinger in branch 'default': Issue #28991: Address comment that the __len__ call looked unattractive https://hg.python.org/cpython/rev/5ec5bfcf0089 -- ___ Python tracker

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset c23f8614151d by Raymond Hettinger in branch '3.5': Issue #28991: Fix obscure reentrancy bug in functools.lru_cache(). https://hg.python.org/cpython/rev/c23f8614151d -- nosy: +python-dev ___ Python tracke

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > How does the patch look to you? It looks ugly, but technically correct. Push it if you like. -- assignee: serhiy.storchaka -> rhettinger stage: patch review -> commit review ___ Python tracker

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: It is effortless to make this change and is consistent with all the other efforts taken to to protect against reentrancy, so yes, I think it should be done. It isn't so much that I want this to be a use case, I would just like the implementation to be as s

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Wrapping len() in an lru_cache is bad idea, because this brakes len() of lists, dicts and other non-hashable collections. Should we support this doubtful case? -- ___ Python tracker

[issue28991] Fix obscure lru_cache reentrancy bug

2016-12-16 Thread Raymond Hettinger
New submission from Raymond Hettinger: Call __len__ directly inside the LRU cache code rather than using len(). This helps further encapsulate the cache internals making it less dependent on parts of the environment that are subject to change. -- assignee: serhiy.storchaka components: