Not using structseq in sys?

I want to add sys._wasi_info, but I noticed that everything in sys which stores any structured data uses structseq. But since sys._wasi_info will be new there’s no need to support an index API. And yet it almost feels weird not using structseq since everything else in that module does it that way.

Are there any objections to not using structseq?

Don’t you worry that someday, someone will file a bug saying they’d like to use the index API on this object, but, unlike every other struct in sys, it doesn’t support it?

4 Likes

:laughing:

IMO it’s a good thing to add the tuple API to new sys members (so not use structseq). We can add it later, if someone comes with a good use case for it.

I proposed to deprecate the tuple API of existing sys objects, but multiple users asked to keep it: Deprecate the tuple API (object[index]) of structseq objects like os.stat_result.