ipython / ipython/traitlets

`Application.launch_instance()` does not return any `start()` values

未关闭
#369 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
653
派生
217
平均合并
2 天 21 小时
30 天内合并 PR
2

描述

Currently (v5.0.0.dev) `launch_instance()` method invokes `start()` without returning its value:

def launch_instance(cls, argv=None, **kwargs):
app = cls.instance(**kwargs)
app.initialize(argv)
app.start()

But the `start()` method by default returns the value from any sub-application:

def start(self):
if self.subapp is not None:
return self.subapp.start()

So any values returned from the *sub-app* are lost if `launch_instance()` is used.

Is that on purpose?

## Sidenote
Strangely, in jupyter, the `JupyterApp.launch_instance()` method returns whatever the `Application.launch_instance()` return, which is nothing of course, and the question is: why does it return a guranteed `None`?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。