Coder Social home page Coder Social logo

Comments (4)

serhiy-storchaka avatar serhiy-storchaka commented on August 17, 2024 3

It has nothing to do with JSON, I do not think that such link is relevant. It can even cause confusion, because the subset of Python syntax is compatible with JSON, this can look like suggestion to use pprint to produce JSON.

from cpython.

ericvsmith avatar ericvsmith commented on August 17, 2024 2

I think the number of people who use json to print out python objects, who would also read the json documentation and find a pprint reference to do something sort of (but not really) related is very, very small. I don't think this should be added.

from cpython.

nineteendo avatar nineteendo commented on August 17, 2024

JSON is not only used for storing data, it's also used for displaying information in human readable form, we even have an example of that in the documentation. I have messed around with custom JSON encoders while there's a module that supports them out of the box. This is precisely why it would have been useful to link to that module. And like shown above, using it to print a list of lists doesn't work well.

I didn't search for a different way to do it, because I already knew json, which works in most cases. But in others I had to use a for loop.

from cpython.

nineteendo avatar nineteendo commented on August 17, 2024

Let me know if you change your mind.

from cpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.