Serhiy Storchaka added the comment:

Recursive partial objects are legitimate. Here is a patch that makes partial's 
repr to support recursive partial objects. Also added a test for pickling.

Cases for Element and file-like objects are questionable. Recursive Element.tag 
and TextIOWrapper.name don't make a sense, and I don't think we should special 
support (and encourage) these cases. To avoid stack overflow we can add a 
restriction for tag to be str or None, but file's name attribute can be 
dynamic. We can omit name from repr if it is not None, str, bytes or int.

----------
keywords: +patch
Added file: http://bugs.python.org/file40932/partial_recursive_repr.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25455>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to