Code Monkey home page Code Monkey logo

Comments (4)

tgregg avatar tgregg commented on July 20, 2024 1

Yeah thinking more about it, I don't think it's worth the extra complexity at this point. As you point out, we'd probably have to add buffering and modify the coroutine transactions to get it to work. I'd suggest implementing the simpler version you outlined above; we can revisit some of the more complex options like this if there's sufficient demand.

from ion-python.

joshterrell805 avatar joshterrell805 commented on July 20, 2024

Hey I think I have a decent solution to this. Before I write tests, is this an appropriate pretty print representation? (indentation amount is configurable):

(venv) ~/repos/ion-python$ python ex.py
# input
{a: [4, yes::hello::2, (b (a c))], b: z::7} x [4]
# output
$ion_1_0
{
  'a': [
    4,
    'yes'::'hello'::2,
    (
      'b'
      (
        'a'
        'c'
      )
    )
  ],
  'b': 'z'::7
}
'x'
[
  4
]

from ion-python.

tgregg avatar tgregg commented on July 20, 2024

Yes, that looks pretty good. I think it would be nice to have some way to keep small containers on a single line. For example,
[4]
is arguably more readable than

[
  4
]

from ion-python.

joshterrell805 avatar joshterrell805 commented on July 20, 2024

Agreed that [4] would look better. Hrmmm. I'll see if I can do that simply.

The approaches I can think of require buffering some of the stream/generator (perhaps the first two or three elements) until I can determine whether a container is "small" or not. Is it acceptable to buffer some of the ion_event stream instead of yielding all data for a given ion_event immediately?

from ion-python.

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.