Created
April 11, 2013 06:30
-
-
Save richo/5361188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo(object): | |
| def method(self, foo): | |
| def _(n): | |
| print repr(self) | |
| print repr(n) | |
| return _ | |
| foo = Foo() | |
| foo.thing = foo.method("butts") | |
| foo.thing("lols") # meth's definition has access to self via local scope |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment