Created
March 14, 2016 05:32
-
-
Save cwhy/df92d4adcf163aae3f17 to your computer and use it in GitHub Desktop.
Class-like dictionary in 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
# It is not very pythonic but I don't like a lot of [[[['''']]]]'''' symbols | |
class Fake_dict: | |
def __iter__(self): | |
for attr in dir(Fake_dict): | |
if not attr.startswith("__"): | |
yield attr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment