2016-01-12 0:07 GMT+01:00 Gregory P. Smith <g...@krypto.org>: >> Changes >> ======= >> >> (...) > > Please be more explicit about what tests you are performing on the values. > setitem's "if the value is different" really should mean "if value is not > dict['key']". similarly for update, there should never be equality checks > performed on the values. just an "is" test of it they are the same object > or not.
Ok, done. By the way, it's also explained below: values are compared by their identify, not by their content. For best dict efficiency, we can not implement this micro-optimization (to avoid a potential branch misprediction in the CPU) and always increase the version. But for guards, the micro-optimization can avoid a lot of dictionary lookups, especially when a guard watches for a large number of keys. Victor _______________________________________________ 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