The decorator is already available in the module as _recursive_repr , so it's just a matter of application. Has this already been discussed elsewhere? This is a minor feature, which does not need previous discussion elsewhere Links to previous discussion of this feature: No response Activity ...
Python reprlib.recursive_repr用法及代码示例用法: @reprlib.recursive_repr(fillvalue='...') __repr__() 方法的装饰器,用于检测同一线程中的递归调用。如果进行递归调用,则返回 fillvalue,否则,进行通常的 __repr__() 调用。例如: >>> from reprlib import recursive_repr >>> class MyList(list): .....
Files recursive_repr.patch: Patch with test and docs Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state. Show more details Author rhettinger commented on Sep 13, 2010 Add a recursive_repr() decorator to provide a solution...