Created
January 24, 2013 17:42
-
-
Save medwards/4625606 to your computer and use it in GitHub Desktop.
Trying to extract a dependency
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
def add_foos(stuff): | |
for thing in stuff: | |
thing['foo'] = float(thing['id']) * 2.0 | |
return stuff | |
class ConnectorThing(object): | |
result_enricher = add_foos | |
def get_results(self): | |
# do something | |
bar = [{'id': 1}, {'id': 2}, {'id': 3}] | |
bar = self.result_enricher(bar) | |
ConnectorThing.get_results() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment