Skip to content

Instantly share code, notes, and snippets.

@public
Created July 8, 2013 12:50
Show Gist options
  • Select an option

  • Save public/5948517 to your computer and use it in GitHub Desktop.

Select an option

Save public/5948517 to your computer and use it in GitHub Desktop.
def block(func, args):
def decorator(f2):
return func(f2, args)
return decorator
@block(map, range(10))
def square(x):
return x**2
print(repr(square))
print(repr(list(square)))
@public

public commented Jul 8, 2013

Copy link
Copy Markdown
Author
<map object at 0x7ffff67803d0>
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment