On Sat, Apr 16, 2016 at 5:01 PM, Victor Stinner <victor.stin...@gmail.com> wrote: > * I mentionned that version++ must be atomic, and that in the case of > CPython, it's done by the GIL
Better; if those methods *already* hold the GIL, it is worth saying "already", to indicate that the change is not expensive. > * I removed the dict[key]=value; dict[key]=value. It's really a > micro-optimization. I also fear that Raymond will complain because it > adds an if in the hot code of dict, and the dict type is very > important for Python performance. That is an acceptable answer. Though I really do prefer explicitly *refusing to promise* either way when the replacement/replaced objects are ==. dicts (and other collections) already assume sensible ==, even explicitly allowing self-matches of objects that are not equal to themselves. I don't like the idea of making new promises that violate (or rely on violations of) that sensible == assumption. -jJ _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com