SIGN IN SIGN UP

Fix type hints in sorts/tim_sort.py, relates to #14457 (#14474)

* Add type hints to tim_sort.py, relates to #14457

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix ruff PYI041 error: use float instead of int | float

* Fix mypy error: support str and tuple inputs as defined in doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix ruff E501: wrap binary_search parameters to respect 88 char limit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactor generics to use Python 3.12 type parameter syntax (PEP 695)

* Use Any from typing to resolve mypy list unpacking bugs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
A
Alessandro Molinari committed
144ef9c022d556b3546de2ece425da709e50ec0c
Parent: abf7168
Committed by GitHub <noreply@github.com> on 5/18/2026, 10:14:42 PM