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 <[email protected]>
<http://bugs.python.org/issue25956>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com