streamz icon indicating copy to clipboard operation
streamz copied to clipboard

Documentation about weakrefs

Open jrmlhermitte opened this issue 7 years ago • 2 comments

We should eventually make sure this gets into the documentation (in reaction to #72)

Something like:

s = Stream()
s2 = s.map(lambda x : x  + 1)
s2.map(print)
s.emit(1)

won't print but

s = Stream()
s2 = s.map(lambda x : x  + 1)
s2.sink(print)
s.emit(1)

will print. Also, mention the subtlety that the first code block will print if run in an ipython terminal because the return results are stored in internal variables. (i.e.

In [1]: from streamz import Stream

In [2]: s = Stream()

In [3]: s2 = s.map(lambda x : x+1)

In [4]: s2.map(print)
Out[4]: <streamz.core.map at 0x7fc750b13ba8>

In [5]: _
Out[5]: <streamz.core.map at 0x7fc750b13ba8>

jrmlhermitte avatar Oct 04 '17 21:10 jrmlhermitte

I agree that we should document this. I plan to do a rewrite of the existing documentation soon, hopefully sometime next week.

On Wed, Oct 4, 2017 at 5:34 PM, Julien Lhermitte [email protected] wrote:

We should eventually make sure this gets into the documentation (in reaction to #72 https://github.com/mrocklin/streamz/pull/72)

Something like:

s = Stream() s2 = s.map(lambda x : x + 1) s2.map(print) s.emit(1)

won't print but

s = Stream() s2 = s.map(lambda x : x + 1) s2.sink(print) s.emit(1)

will print. Also, mention the subtlety that the first code block will print if run in an ipython terminal because the return results are stored in internal variables. (i.e.

In [1]: from streamz import Stream

In [2]: s = Stream()

In [3]: s2 = s.map(lambda x : x+1)

In [4]: s2.map(print) Out[4]: <streamz.core.map at 0x7fc750b13ba8>

In [5]: _ Out[5]: <streamz.core.map at 0x7fc750b13ba8>

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrocklin/streamz/issues/77, or mute the thread https://github.com/notifications/unsubscribe-auth/AASszIGVfMVpuWQuwiqmKgtfV33IiFw-ks5so_nMgaJpZM4PuRQ8 .

mrocklin avatar Oct 04 '17 21:10 mrocklin

great. let me know if you want assistance. i could write some use case examples that i feel have helped me in the very beginning.

jrmlhermitte avatar Oct 05 '17 13:10 jrmlhermitte