These are chat archives for ipython/ipython

29th
Oct 2014
Jason Grout
@jasongrout
Oct 29 2014 16:00
@jdfreder, @takluyver, @SylvainCorlay - it seems there are more places where we assume models are created synchronously. For example, when sending a model id from python to javascript, the model id is replaced with the model on the js side. What if the model hasn't been created yet?
Jonathan Frederic
@jdfreder
Oct 29 2014 18:15
Hmmm, shoot. I think the best solution is to make the 'unpacking' function asynchronous..
I'll have to look closer at it though
Jason Grout
@jasongrout
Oct 29 2014 19:03
Is the 2-week deadline to the 3.0 beta, or 3.0RC?
Thomas Kluyver
@takluyver
Oct 29 2014 19:05
I'm not sure where 2 weeks comes from, I think it's just a rough expression that we want to wrap up big changes to 3.0 fairly soon so they have a chance to stabilise before release.
Jason Grout
@jasongrout
Oct 29 2014 19:21

FYI, re: promises, http://www.html5rocks.com/en/tutorials/es6/promises/ says "As of Chrome 32, Opera 19 & Firefox 29, promises are enabled by default. They're in WebKit nightlies so expect them in the next release of Safari, and they're in development in IE.

To bring browsers that lack a complete promises implementation up to spec compliance, or add promises to other browsers and Node.js, check out the polyfill (2k gzipped)."

Jonathan Frederic
@jdfreder
Oct 29 2014 19:40
@jasongrout we just talked about this problem some more, this will be my order of operations for 3.0:
1) Try using callbacks
2) Try using promises
3) Worst case scenario, remove require.js support for 3.0 and reimplement in 4.0 with proper callback and/or promise system.
Jason Grout
@jasongrout
Oct 29 2014 21:06
?
Jason Grout
@jasongrout
Oct 29 2014 21:19
@jdfreder: I don't see anything after your colon "for 3.0:" above
Thomas Kluyver
@takluyver
Oct 29 2014 21:38
He said:
1) Try using callbacks
2) Try using promises
3) Worst case scenario, remove require.js support for 3.0 and reimplement in 4.0 with proper callback and/or promise system.
Jason Grout
@jasongrout
Oct 29 2014 21:46
@jdfreder: I'm doing some short experiments with returning a promise when creating a view or a model.
Jason Grout
@jasongrout
Oct 29 2014 22:19
@jdfreder: we're looking at eventfuldict and EventfulLIst. Do those actually do anything? They don't look they do anything.
Thomas Kluyver
@takluyver
Oct 29 2014 22:21
@jasongrout - I think Jon is driving back to SLO, so he won't be responding for a few hours
Jason Grout
@jasongrout
Oct 29 2014 22:22
Okay, thanks. I just figured it out---traitlets.py has the EventfulDict traitlet, while eventful.py has the EventfulDict class. That was confusing us for a few minutes.
Thomas Kluyver
@takluyver
Oct 29 2014 22:23
OK, great
Thomas Kluyver
@takluyver
Oct 29 2014 23:31
@minrk I'm inserting text into cells programmatically using cell.get_pre_cursor() + text + cell.get_post_cursor(). get_pre/post_cursor do the js equivalent of str.strip(), because IPython's own code uses them only to split a cell, but that's obviously wrong when inserting text. Is there another method I should be using instead, or should I move the strip operation from those methods up to split_cell so I can use them like this?
Jason Grout
@jasongrout
Oct 29 2014 23:31
@jdfreder: I see what you did there. You gave me a "promise" for an answer. Hopefully it's resolved at some point. I'm going to take advantage of this promise architecture and asynchronously do other things instead of stalling here waiting for your answer :)