marl / jams

A JSON Annotated Music Specification for Reproducible MIR Research
ISC License
186 stars 27 forks source link

Why does JObject inherit from object instead of dict? #27

Closed bmcfee closed 9 years ago

bmcfee commented 9 years ago

(paging @ejhumphrey )

Legit question, I'm curious if this was a conscious decision, and if so, what the reasons are/were.

Seems like inheriting from dict would let us ditch several one-liners which reimplement (most of) the dict interface?

ejhumphrey commented 9 years ago

This is a gardening issue... What started as an object evolved into a dict, and it's totally sane / reasonable to consolidate now. On 7 Mar 2015 20:47, "Brian McFee" notifications@github.com wrote:

(paging @ejhumphrey https://github.com/ejhumphrey )

Legit question, I'm curious if this was a conscious decision, and if so, what the reasons are/were.

Seems like inheriting from dict would let us ditch several one-liners which reimplement (most of) the dict interface?

— Reply to this email directly or view it on GitHub https://github.com/marl/jams/issues/27.

bmcfee commented 9 years ago

Right.

I think, once #26 is settled, that I'll rewrite JObject to inherit from dict. There should be no change in functionality, and it should allow us to cut down some redundant code and simplify tests.

bmcfee commented 9 years ago

This actually seems unnecessary in retrospect. The dict-interface is really only helpful for serialization, and otherwise we really want an object/named tuple style interface.

Closing this one out.