Antoine Pitrou added the comment: > Isn't list(dict) atomic? At least in CPython.
I doubt it. There's no special code for list(dict), it uses regular iteration which could probably hit the GC and then release the GIL. > I suspect that protecting *all* accesses to _data with a lock will hit the > performance and invalidate the reason of using _data for caching. I'm not convinced os.environ is performance-critical. Perhaps getenv() is really expensive on some systems? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30441> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com