-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive Repr #54049
Comments
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. |
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 bpo-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?) |
Committed in r84792. |
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/ :) |
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
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: