Python 3 support¶
Funcy works with python 3 as of version 0.9. However, it has slightly different interface. It follows python 3 convention of “iterator by default” for utilities like map()
, filter()
and such. When funcy has two versions of utility (list and iterator) they are named like keep()
and ikeep()
in python 2 and lkeep()
and keep()
in python 3. You can look up a full table of differently named functions below.
Writing cross-python code¶
You can do that two ways: writing python 2 code that works in python 3 or vice versa. You can import python 2 or 3 style functions from funcy.py2
or funcy.py3
:
from funcy.py2 import whatever, you, need
# write python 2 style code here
from funcy.py3 import whatever, you, need
# write python 3 style code here
You can even import map()
, imap()
, filter()
, ifilter()
, zip()
and izip()
.