Created
January 7, 2014 21:17
-
-
Save AstraLuma/8307064 to your computer and use it in GitHub Desktop.
This is an idea for a method of defining function bodies inside of eg: JSON properties, special files, or other methods. Inspired by a dislike of existing CouchDB query servers for python. Implemented as an ast post-processor.
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
import os | |
import sys | |
# Approximate | |
def _generated_function_name(**__args__): | |
spam = __args__['spam'] | |
eggs = __args__['eggs'] | |
del __args__ | |
return os.path.exists(os.path.join(spam, eggs)) |
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
from __args__ import spam, eggs | |
import os | |
import sys | |
return os.path.exists(os.path.join(spam, eggs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment