Skip to content

Instantly share code, notes, and snippets.

@cwhy
Created March 14, 2016 05:32
Show Gist options
  • Save cwhy/df92d4adcf163aae3f17 to your computer and use it in GitHub Desktop.
Save cwhy/df92d4adcf163aae3f17 to your computer and use it in GitHub Desktop.
Class-like dictionary in python
# 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