Skip to content

Conversation

@joncotton
Copy link
Contributor

Custom classes don't serialize well and AttrDict is no exception. The Url model built from JSON cannot be serialized back to JSON. This is a symptom of reimplementing a core language data structure.

BREAKS BACKWARD COMPATIBILITY

This PR introduces a failing test to demonstrate the problem. AttrDict is replaced with a native Python dictionary and this breaks backward compatibility - namely dictionaries should behave like dictionaries and so a) Url no longer has attribute access to the data members and b) nested dictionaries aren't coerced into AttrDict.

joncotton added 3 commits May 16, 2013 16:57
…structure. Furthermore, the custom AttrDict doesn't JSON serialize so an object built from JSON cannot be serialized back to JSON.

**BREAKS BACKWARD COMPATIBILITY.** This is now a real Python dictionary and *no longer has attribute access* for the data. This could be added back, but it's un-pythonic and introduces complexity. UserDict retains the ability to access `data`. The `dict` property is gone.
@screeley screeley merged commit 1127f06 into embedly:master Jun 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants