Created
August 14, 2012 15:07
-
-
Save PaulGuo/3350139 to your computer and use it in GitHub Desktop.
Python tuple to list
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 to_list(t): | |
return [i if not isinstance(i,tuple) else to_list(i) for i in t] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment