Why is it that
we rejoice at a birth and grieve at a
funeral? It is
because we are not the person involved.
— Pudd'nhead
Wilson's Calendar
Интересный
пакет для разработки на Python: PyToolz.
The Toolz project
provides a set of utility functions for iterators, functions, and
dictionaries. These functions are designed to interoperate well,
forming the building blocks of common data analytic operations. They
extend the standard libraries itertools and functools and borrow
heavily from the standard libraries of contemporary functional
languages.
Toolz provides a
suite of functions which have the following virtues:
Composable: They
interoperate due to their use of core data structures.
Pure: They don’t
change their inputs or rely on external state.
Lazy: They don’t
run until absolutely necessary, allowing them to support large
streaming data sets.
This gives
developers the power to write powerful programs to solve complex
problems with relatively simple code which is easy to understand
without sacrificing performance. Toolz enables this approach,
commonly associated with functional programming, within a natural
Pythonic style suitable for most developers.
Библиотека
дает питонистам инструменты, которыми
гордятся пишущие на функциональных
языках
While Python was
originally intended as an imperative language [Guido], it contains
all elements necessary to support a rich set of features from the
functional paradigm. In particular its core data structures, lazy
iterators, and functions as first class objects can be combined to
implement a common standard library of functions shared among many
functional languages.
This was first
recognized and supported through the standard libraries itertools and
functools which contain functions like permutations, chain and
partial to complement the standard map, filter, reduce already found
in the core language. While these libraries contain substantial
functionality they do not achieve the same level of adoption found in
similar projects in other languages. This may be because they are
incomplete and lack a number of commonly related functions like
compose and groupby which often complement these core operations.
A completion of this
set of functions was first attempted in the projects itertoolz and
functoolz (note the z). These libraries contained several functions
that were absent in the standard itertools/functools libraries. The
itertoolz/functoolz libraries were eventually merged into the
monolithic toolz project described here.
Most contemporary
functional languages (Haskell, Scala, Clojure, ...) contain some
variation of the functions found in toolz. The toolz project
generally adheres closely to the API found in the Clojure standard
library
Рекомендовано
всем, кому не хватает функциональности
в императивности.
original post http://vasnake.blogspot.com/2013/10/toolz.html
Комментариев нет:
Отправить комментарий