Serhiy Storchaka added the comment: Ah, yes, 5dbf3d932a59 partially fixed this optimization. Saving None in a tuple (as I believe done in itertools/zip/enumerate optimization) should fix this issue. I agree that the code is too tricky (as well as the code in itertools/zip/enumerate). It would be better to make tuple creation faster instead of adding special caches in separate functions (see also issue23507). But for now this optimization makes attribute access in named tuples 30% faster, and this is good argument for keeping it.
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26811> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com