Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __repr__ to Json object for better logging #191

Closed
psycoteam opened this issue Feb 3, 2014 · 2 comments
Closed

Add __repr__ to Json object for better logging #191

psycoteam opened this issue Feb 3, 2014 · 2 comments

Comments

@psycoteam
Copy link

Originally submitted by: Oleg Anashkin

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: #9

@dvarrazzo
Copy link
Member

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)?

@dvarrazzo
Copy link
Member

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.

joulez pushed a commit to joulez/psycopg2 that referenced this issue Nov 13, 2014
This issue was closed.
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

No branches or pull requests

2 participants