Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
What you propose would make it nearly impossible for a program to determine if
a key
was rejected for being missing or for being unsupported. Support varies for keys
across different versions of mutagen.
The current state of play is...
KeyError indicates data not present (read).
ValueError indicates feature not present (read/write).
Original comment by nondicti...@gmail.com
on 6 Jan 2010 at 4:01
I think __getitem__ (and __delitem__) should never be raising a ValueError. A
missing
key and an unsupported key are identical from the perspective of the getter,
since an
unsupported key is always missing.
__setitem__ should probably throw a custom subclass of both KeyError and
ValueError,
for compatibility.
Original comment by joe.wreschnig@gmail.com
on 6 Jan 2010 at 4:52
Original comment by joe.wreschnig@gmail.com
on 8 Jan 2010 at 11:16
In fact my idea was so good I implemented it months ago. The current EasyID3
module
raises a subclass of KeyError and ValueError, and mutagen.id3.error, for all the
reasons described above.
Original comment by joe.wreschnig@gmail.com
on 8 Jan 2010 at 11:20
Original issue reported on code.google.com by
JT.doppl...@gmail.com
on 1 Jan 2010 at 10:55Attachments: