Closed xiaxinmeng closed 2 years ago
This works fine on MacOS with gpython from master branch and it also work on Ubuntu 20.04, even if the result is different than CPython (in CPython the set is sorted, in gpython the order changes every time I print, probably an issue of sets being implemented as a map)
strictly speaking, I don't see why set
output should be sorted.
according to:
A set object is an **unordered** collection of distinct hashable objects.
(emphasis, mine)
tentatively closing this as invalid (I also couldn't reproduce on master
)
CPython can well handle the following program test.py, while gpython cannot transform it automatically.
test.py ''' s = set(range(100)) '''
Crashing Information: gpython test.py ''' panic: interface conversion: py.Object is *py.Range, not py.Tuple
goroutine 1 [running]: github.com/go-python/gpython/py.SetNew(0xc0000d50e0, 0xc0000dceb0, 0x1, 0x2, 0x0, 0x6abfc0, 0xc0000cc680, 0xc0000f7610, 0x40bc6d) /home/ncw/go/src/github.com/go-python/gpython/py/set.go:63 +0x20d ..... main.main() /home/ncw/go/src/github.com/go-python/gpython/main.go:113 +0x7ff '''
version: Gpython 3.4.0 on Ubuntu 16.04