Carl Meyer added the comment: Thanks, Danny. Uploaded a version of the patch that adds thread-safety (with a test). Unlike in your lib, I didn't make it a separate version of the decorator; since the lock is not checked on cached access, its slight overhead on the initial computation is probably not an issue, likely outweighed by the cost of the computation itself.
If someone decides to pursue a C version with slots support, hopefully at least these tests are still useful :-) ---------- Added file: http://bugs.python.org/file45452/cached_property.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21145> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com