Skip to main content

Lispy (and some haskelly) missing batteries for Python.

Project description

Python clearly wants to be an impure-FP language. A decorator with arguments is a curried closure - how much more FP can you get?

We provide some missing features for Python from the list processing tradition, plus a few bonus haskellisms.

We place a special emphasis on clear, pythonic syntax, as far as possible without MacroPy. Other design considerations are simplicity, robustness, and minimal dependencies (currently none).

Tail call optimization (TCO), TCO’d loops in FP style, call/ec, let & letrec, assign-once, multi-expression lambdas, def as a code block, dynamic assignment, memoize (also for generators and iterables), compose, folds and scans (left and right), unfold, lazy partial unpacking of iterables, functional sequence updates, pythonic lispy linked lists.

We also provide a curry that passes extra arguments through on the right, and calls a callable return value on the remaining arguments. This is now valid Python:

mymap = lambda f: curry(foldr, composerc(cons, f), nil)
myadd = lambda a, b: a + b
assert curry(mymap, myadd, ll(1, 2, 3), ll(2, 4, 6)) == ll(3, 6, 9)

For documentation and examples, see the project’s GitHub homepage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unpythonic-0.9.2.tar.gz (113.3 kB view details)

Uploaded Source

Built Distribution

unpythonic-0.9.2-py3-none-any.whl (128.4 kB view details)

Uploaded Python 3

File details

Details for the file unpythonic-0.9.2.tar.gz.

File metadata

  • Download URL: unpythonic-0.9.2.tar.gz
  • Upload date:
  • Size: 113.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.4.3

File hashes

Hashes for unpythonic-0.9.2.tar.gz
Algorithm Hash digest
SHA256 50ea9156ac70ea841949a5d499380fe4f570786919661d03a82fa33af258a761
MD5 0b8c330e3f4e325e2555f4a44987fc3e
BLAKE2b-256 4876e12d7dc2c3653308e37054db6506c9f3e1b7b0f06c7c1a5e1d5cfbd2a22d

See more details on using hashes here.

File details

Details for the file unpythonic-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: unpythonic-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 128.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.4.3

File hashes

Hashes for unpythonic-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bccbd6025dcee9529a8fc467aad3701fcb00c66cda00fb07b674c4e561f2209
MD5 7b988df2abdb95d3e54d033cabc0baae
BLAKE2b-256 e38b4682a38f4272263cb4e899a9f5b6d4fa14e44ad600db1f38af8d3f606a7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page