Skip to content

Commit

Permalink
add attrdict
Browse files Browse the repository at this point in the history
  • Loading branch information
Sxela authored Aug 4, 2022
1 parent 6a91e2c commit 753fd9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dataclasses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
""" A Js-like dict. Keys can be accessed both in foo["bar"] and foo.bar manner.

class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self

0 comments on commit 753fd9d

Please sign in to comment.