Skip to main content

Syntax changes for python lambdas.

Project description

Build Status

What is this?

A better python lambda syntax for your anonymous function needs.

Write a = (x) > x instead of a = lambda x: x. See below for syntax caveats.

Get started immediately: pip install lambdazen

from lambdazen import zen
def otherfunc(*args):
    print sum(args)

@zen
def example():
    example.epic = (x, y, z) > otherfunc(x, y, z)

example.epic(1,2,3)
>>> 6

Caveats

  • better lambdas can only be defined in a function with the @zen attribute

  • any other code in this function will be executed, it’s best to use the function as a container of lambdas

How does it work

Read the story

TLDR; Runtime in-memory source rewriting and recompilation

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

lambdazen-0.1.2.tar.gz (1.9 kB view hashes)

Uploaded Source

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