Created
May 19, 2015 12:39
-
-
Save homelinen/757a83ee0540c121665e 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
> + for child in config.children: | |
> + if child.key == "TypesDB": | |
> + paths = child.value | |
I think there's probably a more Pythonic way to do this. | |
List comprehensions is one | |
paths = [ child.value for child in config.children if child.key == "TypeDB" ] | |
Using filter to filter out the children and then doing a list comprehension is more readable than above but requries two O(n) loops. | |
What is written works, and I think there's a better way than my two suggestions. Feel free to ignore. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment