Skip to main content

functional extensions

Project description

ject

functional extensions

Features

  • length: get length of function parameters
  • oneself: returns the parameter itself
  • pipe: pipe chain of functions

Usage

get length of function parameters

from ject import length

def fun(a, b, *args, **kwargs): return a, b, args, kwargs

print(length(fun)) # 4

pipe chain of functions

from ject import pipe

def add_one(n): return n + 1
def times_two(n): return n * 2

add_one_then_times_two = pipe(add_one, times_two)
print(add_one_then_times_two(4))  # 10

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

ject-0.0.3.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

ject-0.0.3-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

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