Created
August 9, 2013 14:19
-
-
Save Slater-Victoroff/6193947 to your computer and use it in GitHub Desktop.
The most functional line of python
This file contains 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 random_document(document_layout, type, **kwargs): | |
document_layout.append("dummy_item") | |
doc = lambda l:{l[i]:doc(l[i+1]) if isinstance(l[i+1],list) else random_item(type,**kwargs) for i in range(len(l)-1)} | |
return doc(document_layout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment