Stefan Behnel <stefan...@behnel.de> added the comment:

> Also, later, these structures may change to be more efficient.

Tuples? Really?

Ok, quoting PEP-620:
> Members of … PyTupleObject structures have not changed since the "Initial 
> revision" commit (1990)

I honestly think the reason for that might simply be that there's not so much 
to improve for tuples.

> nothing prevents a C extension to get or set directly
> PyTupleObject.ob_item[0] (the first item of a tuple).

I certainly understand that that is a problem, especially if "PyObject" may 
change in the future. And this is essentially what the current 
"PyTuple_GET_ITEM()" macro does in a binary module.

Should we also turn "_PyTuple_ITEMS()" into a public inline function then to 
make up for the loss of the "&PyTuple_GET_ITEM(t, 0)" pattern? It would make it 
explicit what is intended. I think that should be our main goal in the CPython 
side.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41078>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to