> This API was around for years, with people using tuple indexing either explicitly or through destructuring assignment.
FWIW destructuring assignment uses the iteration protocol[0] not indexing.
[0] which can fallback on indexing if there is no explicit iteration support, IME that tends to be more unhelpful than convenient
This was replaced with a namedtuple. The following is from Python 2.7.10:
The old tuple-based API still works, so it doesn't break backwards compatibility, while it also gives people the ability to migrate to an attribute-based API.That said, it's very hard to remove the old API. The latest version of Python, in url/parse.py:urlparse, still supports tuple-based indexing.
Perhaps Python 4 will remove that behavior? Probably not. At the very least there would need to be a namedtuplemigration type which gives a warning if the old tuple API is used when only attribute lookup is expected.