This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年09月12日 22:13 by rhettinger, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
Files | ||||
---|---|---|---|---|
File name | Uploaded | Description | Edit | |
recursive_repr.patch | rhettinger, 2010年09月12日 22:13 | Patch with test and docs |
Messages (4) | |||
---|---|---|---|
msg116239 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2010年09月12日 22:13 | |
Add a recursive_repr() decorator to provide a solution to the problem of creating a container __repr__ method that doesn't fail for recursive calls. |
|||
msg116257 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2010年09月13日 00:13 | |
Good idea. I wonder if the genericity (being able to specify the placeholder) is needed; the ellipsis is used by built-in containers (not documented AFAICT, see #9842) and seems a good choice for most (all?) of the cases. What bothers me is that this simple, common case can’t just use @recursive_repr (without parens) which seems to me more natural. One markup glitch: :meth:`repr__` lacks two underscores. (Unimportant side question: Since collections defines __all__, why are imported names renamed with a trailing underscore?) |
|||
msg116353 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2010年09月13日 21:37 | |
Committed in r84792. |
|||
msg133047 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年04月05日 16:21 | |
FTR, the answer to my interrogation in my previous message is contained in Raymond’s PyCon talk about API design: http://pycon.blip.tv/file/4883290/ :) |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022年04月11日 14:57:06 | admin | set | github: 54049 |
2011年04月05日 16:21:30 | eric.araujo | set | messages: + msg133047 |
2010年09月13日 21:37:17 | rhettinger | set | status: open -> closed resolution: fixed messages: + msg116353 |
2010年09月13日 00:13:08 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg116257 |
2010年09月12日 22:13:18 | rhettinger | create |