gpython icon indicating copy to clipboard operation
gpython copied to clipboard

Recursive printing of REPR List, Dictionary, Tuple

Open corona10 opened this issue 7 years ago • 3 comments

Expected:

Gpython 3.4.0
>>> a = [1,2,3]
>>> a[0] = a
>>> a
[[...], 2, 3]

Actual behavior:

Gpython 3.4.0
>>> a = [1,2,3]
>>> a[0] = a
>>> a
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

corona10 avatar Aug 05 '18 16:08 corona10

Yes that needs fixing :-)

Want to have a go at fixing it? It probably needs repr to keep a map of visited items

ncw avatar Aug 05 '18 16:08 ncw

That's right approach. AFAIK, some more C API should be implemented which are related to repr_enter and repr_left :)

corona10 avatar Aug 05 '18 17:08 corona10

@ncw Anyway, I will take a look this issue. :)

corona10 avatar Aug 06 '18 02:08 corona10