# Deprecate the tuple API (object\[index\]) of structseq objects like os.stat\_result

**URL:** <https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464>\
**Category:** Core Development\
**Created:** [August 7, 2026, 6:38pm UTC](https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464 "2026-08-07T18:38:13Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![duncathan](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/duncathan/32/25521_2.png) [@duncathan](https://discuss.python.org/u/duncathan)\
**Post date:** [August 31, 2026, 7:58pm UTC](https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464/21 "2026-08-31T19:58:27Z")

</div>

The way I see it, the two statements can co-exist. There’s no need for new types to support a tuple API _for backward compatibility_ - a usage like `sys.version_info > (3, 15)` is evidently for more reasons than simply backward compatibility.

---

<div class="post-metadata">

**Author:** ![mcepl](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mcepl/32/24095_2.png) [@mcepl](https://discuss.python.org/u/mcepl)\
**Post date:** [October 28, 2026, 12:59pm UTC](https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464/22 "2026-10-28T12:59:25Z")

</div>

Would it make sense to change the output of `os.stat()` to be truly `collections.namedtuple` (which should be left alone)?

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [October 28, 2026, 5:05pm UTC](https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464/23 "2026-10-28T17:05:30Z")

</div>

I don’t think that collections.namedtuple supports unnamed members, whereas os.stat() has multiple unnamed members like `os.stat()[9]` (mtime as an integer).

---

<div class="post-metadata">

**Author:** ![mcepl](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mcepl/32/24095_2.png) [@mcepl](https://discuss.python.org/u/mcepl)\
**Post date:** [October 28, 2026, 5:06pm UTC](https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464/24 "2026-10-28T17:06:30Z")

</div>

Yes, we would have to probably add some names to them? Would it be that much a problem?

[Previous page](https://discuss.python.org/t/deprecate-the-tuple-api-object-index-of-structseq-objects-like-os-stat-result/108464.md?page=1)
