[issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter

Matthew Barnett report at bugs.python.org
Wed Aug 12 14:07:00 EDT 2020


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

I think what's happening is that in 'compiler_dict' (Python/compile.c), it's checking whether 'elements' has reached a maximum (0xFFFF). However, it's not doing this after incrementing; instead, it's checking before incrementing and resetting 'elements' to 0 when it should be resetting to 1. The 65535th element isn't counted.

----------
nosy: +mrabarnett

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41531>
_______________________________________


More information about the Python-bugs-list mailing list