> What does this mean for the extra and extra_dejson attrs that exist on
Connection right now?

It's a good question.  I think ideally we should deprecate extra_dejson,
and `extra` should be dict (require json-encodable), with a db type of JSON
where supported.  But the path to get there seems a little murkier.
Deprecating extra_dejson would be straightforward.  But how would you
deprecate extra as string, while enabling folks to migrate to extra as dict
in place...  Maybe make it a `str` subclass that implements `get`?

Something like this:

class ExtraDict(str):

    def __getitem__(self, item):
        return json.loads(self)[item]

    def get(self, item, default=None):
        return json.loads(self).get(item, default)


So then it behaves mostly like a string, but can also be accessed like a
dict?

What do you think?

> Should we provide some way of validating existing connections so users
can check this before upgrading to 3.0?

Sounds like a good idea.

Reply via email to