New submission from Alexander Böhn <fish2...@gmail.com>: Currently, the `reprlib.recursive_repr(…)` decorator allows a “fillvalue” parameter to be specified by the user. This is a string value that is used as a placeholder when calculating an objects’ repr – in the case of `recursive_repr(…)` the “fillvalue” defaults to '...' and may be set by the user to a string of any length.
There is no such user-defined “fillvalue” on the `reprlib.Repr` type, although the '...' string is hardcoded in its implementation and used throughout. I propose that the hardcoded use of the '...' string in the code for the `reprlib.Repr` implementation should be replaced by a “fillvalue” attribute, set on the class in its `__init__(…)` method – and therefore overridable in subclasses, like the existing myriad “max*” instance attributes. PR to follow in short order. ---------- components: Library (Lib) messages: 361334 nosy: fish2000 priority: normal severity: normal status: open title: The reprlib.Repr type should permit the “fillvalue” to be set by the user type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39549> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com