Skip to main content

Enables Python to be functionally chain-styled.

Project description

Build Status PyPI

Enables Python to be functionally chain-styled.

Document

  • Simplified Chinese documents here.

If you are interested in me,you can follow my Blog([STRIKEOUT:一波软广2333])。

How to use?

install form pypi:

$ pip install fc

and you just import Fc,like this: from fc import Fc

then you can enjoy lambda like Kotlin/JS:

from fc import Fc

l = (
  Fc([1, 2, 3, 4, 5])
    .map(lambda x: x + 1)
    .filter(lambda x: x > 4).print()    # [5, 6]
    .map(lambda x: x + 1).print()       # [6, 7]
    .cat([8, 9]).print()                # [6, 7, 8, 9]
    .add(10).print()                    # [6, 7, 8, 9, 10]
    .catHead([1, 2, 3, 4, 5]).print()   # [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    .limit(3)
    .done()
)
assert l == [1, 2, 3]

You can check this this test file and understand more.

Have Fun ;)

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

fc-0.1.10.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file fc-0.1.10.tar.gz.

File metadata

  • Download URL: fc-0.1.10.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fc-0.1.10.tar.gz
Algorithm Hash digest
SHA256 4be807077c2de224de19c41ff1f1ca61ab6df16b2f5f2af3359d0d97162aaadb
MD5 437da13a96f04caf3fb38d79dacd0066
BLAKE2b-256 b4bb49191f65fed1df529c04d7494b5e9066ff7104e9daac6cf30a631006753f

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