__str__ for large objects, would not c++ iostream be more efficient

Discussion in 'Python' started by alf, Aug 29, 2006.

  1. alf

    alf Guest


    is there any way in Python to have iostream like __str__ operator?
    alf, Aug 29, 2006
    1. Advertisements

  2. Define a method writeTo(f) if you want, and instead of:

    f.write('%s' % obj)



    Gabriel Genellina
    Softlab SRL

    Preguntá. Respondé. Descubrí.
    Todo lo que querías saber, y lo que ni imaginabas,
    está en Yahoo! Respuestas (Beta).
    ¡Probalo ya!
    Gabriel Genellina, Aug 29, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.