Open xiaxinmeng opened 1 year ago
This one actually works for me with gpython master
$ gpython
Python 3.4.0 (none, unknown)
[Gpython dev]
- os/arch: linux/amd64
- go version: go1.19.1
>>> population = list(range(10))
>>> gen = (-1 * population for w in range(10))
>>> list(gen)
[[], [], [], [], [], [], [], [], [], []]
>>>
In the following example, we initialize a 'population' with a list then we define a generator 'gen'. When we transform the generator into list, it crashes gpython with message "panic: runtime error: makeslice: len out of range".
test.py
Output on go/wasm(https://gpython.org/?wasm):
output with gopherjs(https://gpython.org/):