ipython / ipython/traitlets

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

Aberta
#369 4 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
653
Forks
217
Merge médio
2d 21h
PRs com merge (30d)
2

Descrição

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`?

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start by reading Application.launch_instance() and Application.start(), then inspect any tests covering application startup and sub-applications. Confirm how JupyterApp.launch_instance() uses the result. Done means values returned by start(), including sub-application results, are preserved when launch_instance() is called, with regression coverage.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
cli
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.