m['tag'] = 0 wasn't doing the same thing as m.add('tag', 0), because the test in __setitem__()
was different: if value vs if value or value == 0
So modify it to make behavior much more consistent.
m['tag'] = 0 or m.add('tag', 0) actually set tag to ['0']
m.add('tag', '') does nothing
m['tag'] = '' explicitly delete the tag (removing it from store, adding it to deleted tags)
m = Metadata(tag='') doesn't create an entry 'tag' (at all)
m = Metadata(tag=0) creates a tag, with internal value ['0']
This way, one can rewrite:
self.metadata = Metadata()
self.metadata['album'] = name
self.metadata['albumartist'] = artist
self.metadata['totaltracks'] = 0
to:
self.metadata = Metadata(album=name, albumartist=artist, totaltracks=0)
Without this patch, totaltracks wasn't set at all.
```python
m = Metadata(tag1='a', tag2='b')
del m['tag1']
```
```
m store: {'tag2': ['b']}
m deleted: {'tag1'}
```
```python
m2 = Metadata(tag1='c', tag2='d')
del m2['tag2']
```
```
m2 store: {'tag2': ['b']}
m2 deleted: {'tag1'}
```
```python
m.update(m2)
```
```
m store: {'tag1': ['c']}
m deleted: {'tag1', 'tag2'} <---- this was incorrect, and untested case
```
This patch fixes it, and results to:
```
m store: {'tag1': ['c']}
m deleted: {'tag2'}
```
Add a config for isort (https://github.com/timothycrosley/isort)
Run isort -rc . and make import style consistent across files
Add a note about `isort` in CONTRIBUTING.md