The implementation of comparison for date and datetime objects was changed 18 years ago, in 1996059, but the documentation still describes the old behavior, with special-casing of other objects with a timetuple attribute. There were also other changes in this code. In particularly, there is a significant difference between equality comparison and order comparison. This part of the documentation should be rewritten.
Linked PRs
The implementation of comparison for
dateanddatetimeobjects was changed 18 years ago, in 1996059, but the documentation still describes the old behavior, with special-casing of other objects with atimetupleattribute. There were also other changes in this code. In particularly, there is a significant difference between equality comparison and order comparison. This part of the documentation should be rewritten.Linked PRs