Several of the replies seemed to suggest that re-using the current dict structure for a tuple wouldn't work. Since I'm not sure whether people are still thinking of the old structure, or I'm missing something obvious, I'll be more explicit.
Per https://github.com/python/cpython/blob/master/Include/dictobject.h#L40 the last element of a dict object is now a separate pointer to ma_values, which is an array of objects. Per https://github.com/python/cpython/blob/master/Include/tupleobject.h#L27 the last element of a tuple object is also an array of objects. Is there some reason these arrays cannot be the same memory? e.g., does a tuple header *have* to be contiguous with its data, and if so, is there a reason that the dict's ma_array can't be allocated with an extra tuple-header prefix? -jJ _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/