Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add __repr__ to Json object for better logging

#191

Currently, attempt to log or print Json object uses default python's implementation which is useless. Using actual serialized content is much better.

I have sent a pull request on github with the proposed change: https://github.com/psycopg/psycopg2/pull/9

Reported by Oleg Anashkin · February 3rd, 2014 @ 04:19 AM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from new to open

    As per discussion on github, Json.__str__ should return getquoted() as many adapters already do. Also note:

    1) other adapters should be checked too (range?)
    2) are we returning the right types in py3 (bytes/str)?

    February 3rd, 2014 @ 11:26 PM

  2. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from open to resolved

    Pushed a str implementation for Json in my master. repr won't change.

    I'm not planning to release the change in 2.5 as it may change the programs behaviour in a radical way: the idea is to release it in 2.6.

    February 22nd, 2014 @ 08:48 PM