New submission from Steven D'Aprano <steve+pyt...@pearwood.info>: The functools module imports reduce from _functools, using a guard in case it is not present:
try: from _functools import reduce except ImportError: pass However, the documentation says nothing about reduce being optional, and it is unconditionally included in the module __all__. If reduce is guaranteed to be implemented in _functools, then the guard is redundant and should be removed. Otherwise, a pure python fallback should be added. (The docs for reduce include a pure Python equivalent which might be sufficient.) ---------- components: Library (Lib) keywords: easy messages: 308297 nosy: steven.daprano priority: normal severity: normal status: open title: functools.reduce has a redundant guard or needs a pure Python fallback versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32321> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com