I think your thinking is correct that if the result is just a display that execute_result would be more concise. Testing your messaging pattern through nbconvert is a great way to evaluate how it will be interpreted with a debugger. So I'd recommend testing your patterns there as proof of standard following.
On Mon, 22 Apr 2019, 5:32 PM Nils Bruin, <[email protected]> wrote: > On Monday, April 22, 2019 at 4:35:06 PM UTC-7, Jason Grout wrote: >> >> 2. The execute_result vs display_data difference you see is from how you >> evaluated things. execute_result basically returns the result of displaying >> the last line of execution. display_data messages come from explicitly >> displaying something. To see the display_data message, do something like >> `display(HTML(...))`. >> >> OK. So suppose we have the following scenario > > [Input:] ?SomeCommand > > Desired output: > > Help for SomeCommand <http://dummy/help.html?query=SomeCommand> > > Presently, this is generated by a do_execute amounting to: > > self.send_response(self.iopub_socket, 'display_data', content) > return {'status': 'ok', 'execution_count': self.execution_count, 'payload': > [], 'user_expressions': {}} > > where "content" is a dictionary that successfully encodes the information > for displaying the desired "<a href...". > > Would it be more appropriate to send an 'execute_result' response > instead? Does it matter? Would it just be a matter of replacing > 'display_data' with 'execute_result'? > > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jupyter/b5b5b2e3-55f5-4ee3-b948-e0b6a826ee24%40googlegroups.com > <https://groups.google.com/d/msgid/jupyter/b5b5b2e3-55f5-4ee3-b948-e0b6a826ee24%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAJF6vz5dPk3NE%2BZZkP-7U1uXeP3hdcW3UiRuFiE9dr5mfcFecg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
