Skip to content

Instantly share code, notes, and snippets.

@NicolasT
Created April 22, 2010 20:46
Show Gist options
  • Save NicolasT/375797 to your computer and use it in GitHub Desktop.
Save NicolasT/375797 to your computer and use it in GitHub Desktop.
# class Person:
# def __init__(self, first_name, last_name, age):
# self.first_name = first_name
# self.last_name = last_name
# self.age = age
Person = lambda first_name, last_name, age: \
lambda: (first_name, last_name, age)
first_name = lambda person: person()[0]
last_name = lambda person: person()[1]
age = lambda person: person()[2]
Nicolas = Person('Nicolas', 'T', 24)
print first_name(Nicolas), last_name(Nicolas), 'is', age(Nicolas)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment