msg124035 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-12-15 18:29 |
Attached is a patch to add documentation for Py_ReprEnter and Py_ReprLeave. Assigning to docs@python for review. |
|
|
msg124081 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-12-15 22:35 |
I think this is a bit misleading. These functions are only needed if you are implementing a container. For the general case where you don't display another Python object in your repr() (or you only display objects which are themselves atomic, such as strings and integers), these functions are not necessary. |
|
|
msg124083 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-12-15 22:42 |
Good point. My perspective is skewed by all of the time that I spend working on container types. :-) How about if I change the first sentence to the following? Properly implementing :attr:`tp_repr` for container types requires special recursion handling. |
|
|
msg124085 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-12-15 22:54 |
> How about if I change the first sentence to the following? > > Properly implementing :attr:`tp_repr` for container types requires > special recursion handling. This looks good to me. |
|
|
msg124087 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-12-15 22:58 |
Possibly related: #9840 |
|
|
msg124090 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-12-15 23:05 |
Thanks. New patch attached with a cross-reference to reprlib.recursive_repr. |
|
|
msg124091 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-12-15 23:07 |
Patch LGTM, except for “As examples” which I’ve never read before (but I’m not a native speaker). |
|
|
msg124220 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-12-17 15:58 |
Yep, looks good, please commit. |
|
|
msg124228 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-12-17 16:36 |
Committed in r87339. Thanks everyone for the feedback! |
|
|
msg124260 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2010-12-17 22:17 |
Err... in r87339 there is a typo in all occurrences of 'Py_ReprEntr': Py_ReprEnter of course! |
|
|
msg124261 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-12-17 22:29 |
On Fri, Dec 17, 2010 at 2:17 PM, Amaury Forgeot d'Arc wrote wrote: > Err... in r87339 there is a typo in all occurrences of > 'Py_ReprEntr': Py_ReprEnter of course! Well, that's embarrassing. Fixed in r87354. |
|
|