ipython / ipython/ipykernel

ipykernel restarts with "Restarting kernel..." message

Offen
#776 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
734
Forks
412
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beschreibung

The following minimal example results in the `qtconsole` restarting
```
import numpy as np
remaining_parameters=[]

cost_function_first = lambda x: cost_function_first(np.append(x, remaining_parameters))

cost_function_first([0.])
```
with error message
```
Kernel died, restarting
````
The same happens within a Spyder console

The minimal example has a clear problem: an infinite recursion. But in a normal python session this results in a normal exception with clear error message, e.g.
```
...
File "C:\develop\env-py39\lib\site-packages\numpy\core\fromnumeric.py", line 1819, in ravel
if isinstance(a, np.matrix):
RecursionError: maximum recursion depth exceeded while calling a Python object
```

Within `qtconsole` at least a clear error message should be generated. And preferably the console not restarted.
Within `jupyter notebook` executing the minimal example also results in a crash without proper error messages.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.