Message355385
Verified from Python.
>>> t = (1,2,3)
>>> t2 = t[:]
>>> id(t), id(t2)
(1672756229504, 1672756229504)
A partial slice cannot the original tuple, so I presume that the emphasis is about returning a (new) *tuple*, rather than some sort of view of the original. However,
Py_INCREF(a);
return (PyObject *)a;
date back to at least 1997 (GvR), so the optimization is not new. I don't know what should replace 'New reference.' 'Old or new reverence.'?
"Take a slice of the tuple pointed to by p from low to high and return it **as a new tuple**."
could be replaces with
"Return the slice of the tuple point to by p for low to high. If it is a proper subslice, return a new tuple."
This leave it undefined when a complete slice. |
|
Date |
User |
Action |
Args |
2019-10-25 20:18:29 | terry.reedy | set | recipients:
+ terry.reedy, docs@python, wim.glenn |
2019-10-25 20:18:29 | terry.reedy | set | messageid: <1572034709.8.0.0233762928961.issue38557@roundup.psfhosted.org> |
2019-10-25 20:18:29 | terry.reedy | link | issue38557 messages |
2019-10-25 20:18:29 | terry.reedy | create | |
|