bpo-31581: Reduce the number of imports for functools (GH-3757)

2 files changed