mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 01:53:31 +01:00
Update AttrDict docstring
Co-authored-by: Adrian Sampson <adrian@radbox.org>
This commit is contained in:
parent
7c71bb87a2
commit
4b7f42d214
1 changed files with 2 additions and 12 deletions
|
|
@ -40,18 +40,8 @@ except AttributeError:
|
|||
|
||||
# Classes used to represent candidate options.
|
||||
class AttrDict(dict):
|
||||
"""
|
||||
Dictionary with flexible attributes
|
||||
to get an tag value:
|
||||
value = info.tag
|
||||
or value = info[tag]
|
||||
or value = info.get(tag)
|
||||
or value = getattr(info, tag)
|
||||
all raise AttributeError when info doesn't have tag
|
||||
to set a tag value:
|
||||
info.tag = value
|
||||
or info[tag] = value
|
||||
or setattr(info, tag, value)
|
||||
"""A dictionary that supports attribute ("dot") access, so `d.field`
|
||||
is equivalent to `d['field']`.
|
||||
"""
|
||||
|
||||
def __getattr__(self, attr):
|
||||
|
|
|
|||
Loading…
Reference in a new issue