This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Supports Python 2.6 - 3.5

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)

# The zen decorator allows you to define lambdas with a better syntax
@zen
def example():
    example.epic = (x, y, z) > otherfunc(x, y, z)

    # Multiline lambdas are a tuple or list of statements
    # The assignment operator inside is << instead of =
    # The last statement is the return value
    example.multiline = (x, y, z) > (
        s << otherfunc(x, y, z),
        s
    )

# Call function so the lambdas are bound to function attributes
example()

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

example.multiline(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

Additional Examples

from lambdazen import zen

# Lambdas don't need to be bound to the function
@zen
def normalizeString(nS):
    transforms = [
        (s) > s.strip(),
        (s) > s.lower(),
        (s) > s.replace(' ', '_')]

    apply_all = (transforms_list, s) > (
        is_done << (len(transforms_list) == 0),
        current_transform << transforms_list[0] if not is_done else None,
        remaining_transforms << transforms_list[1:] if not is_done else None,
        current_transform(apply_all(remaining_transforms, s)) if not is_done else s)

    return apply_all(transforms, nS)

normalizeString("Abraham Lincoln")
>>> "abraham_lincoln"
Release History

Release History

0.1.7

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lambdazen-0.1.7.tar.gz (3.8 kB) Copy SHA256 Checksum SHA256 Source Sep 18, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting