[New-bugs-announce] [issue25956] Unambiguous representation of recursive objects

Serhiy Storchaka report at bugs.python.org
Sat Dec 26 10:03:56 EST 2015


New submission from Serhiy Storchaka:

For now repr() of recursive object replaces nested representations of self with a placeholder containing "...": "[...]" for list, "{...}" for dict, "set(...)" for set, and just "..." for Python classes that use reprlib. Unfortunately such replacements are valid expressions in Python 3.

The same replacement is used for too deeply nested objects in reprlib and pprint.

Proposed patch makes "<...>" to be always used as a placeholder. This is invalid syntax and well visually distinguishable.

Python-Ideas discussion: http://comments.gmane.org/gmane.comp.python.ideas/37555

----------
components: Interpreter Core, Library (Lib)
files: repr_recursive.patch
keywords: patch
messages: 257037
nosy: fdrake, ncoghlan, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Unambiguous representation of recursive objects
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41426/repr_recursive.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25956>
_______________________________________


More information about the New-bugs-announce mailing list