最先开始我是用"{}",不过后来觉得"dict()"看起来舒服,逐渐改用 "dict()"了
不过今早看了Doug Hellmann的一篇文章《The Performance Impact of Using dict() Instead of {} in CPython 2.7》 http://doughellmann.com/2012/11/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html
经过各种验证(不得不佩服大牛对技术的钻研精神,和对结论的严谨态度),一般情况下,还是"{}"的效率要高一些
不过今早看了Doug Hellmann的一篇文章《The Performance Impact of Using dict() Instead of {} in CPython 2.7》 http://doughellmann.com/2012/11/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html
经过各种验证(不得不佩服大牛对技术的钻研精神,和对结论的严谨态度),一般情况下,还是"{}"的效率要高一些