On Jan 10, 2007, at 10:32 PM, anderbubble wrote:
>
> Can anyone recommend a way to jsonify a generator such that an entire
> (potentially large) dataset doesn't have to be held in memory, but is
> generated (and reported over http) in-place?
Although probably naïve this might work:
def json_generator(dataset):
yield '['
for i in dataset:
yield jsonify(i)
yield ']'
HTH,
Alberto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---