Message68317
On Tue, Jun 17, 2008 at 12:23 AM, Martin v. Löwis
<report@bugs.python.org> wrote:
>
> Martin v. Löwis <martin@v.loewis.de> added the comment:
>
> After reviewing this again, I'm skeptical that this is a good idea. It
> doesn't achieve its original purpose (anymore), as it only changes
> tp_str for range objects (although it does change tp_repr for dict views
> - why this inconsistency?).
>
The reason for the inconsistency is that there was a strong argument
that the tp_repr for range already returned something useful that
people could take advantage of in their code. The same was not the
case for the dict views.
I do not understand why you think that having the interpreter display
<dict_keys: 2, 3, 4, ...>
when x.keys() is called is not an improvement over
<dict_keys object at 0xe72b0>
Maybe it is just because I spend a lot more time in the interactive
interpreter that I see this as a big improvement.
So if, as Raymond Hettinger suggests, the interpreter is the right
place to make this change I'd still be happy to provide a patch if
someone could give me a pointer for where to start looking.
Brad
> So I'm -0 on the patch, meaning that I won't commit it, but won't object
> to anybody else committing it, either.
>
> Technically, in dictview_repr, the first call to PyUnicode_Concat isn't
> checked for exceptions.
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue2610>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2008-06-17 12:29:52 | bmiller | set | spambayes_score: 0.00026113 -> 0.0002611303 recipients:
+ bmiller, loewis, rhettinger, amaury.forgeotdarc, belopolsky, benjamin.peterson |
2008-06-17 12:29:46 | bmiller | link | issue2610 messages |
2008-06-17 12:29:44 | bmiller | create | |
|