Why not to use functools.reduce in Python

Why not to use functools.reduce in Python

Python Morsels

55 лет назад

983 Просмотров

Python's 'reduce' function can "reduce" an iterable to a single value. But the `reduce` function is often more hassle than it's worth.

https://pym.dev/reduce/

Find more Python screencasts at https://pym.dev/screencasts/

00:00 What is the functools.reduce function?
00:15 Performing arithmetic (a bad example)
00:59 A more complex example
01:49 Don't re-invent the wheel
02:57 Common reduce operations in Python
03:23 Try to avoid functools.reduce

Тэги:

#python
Ссылки и html тэги не поддерживаются


Комментарии: