This is the mail archive of the
mailing list for the GCC project.
Re: [patch] make the libstdc++ pretty printers compatible with both Python 2 and Python3
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Matthias Klose <doko at ubuntu dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 9 May 2014 15:32:46 +0100
- Subject: Re: [patch] make the libstdc++ pretty printers compatible with both Python 2 and Python3
- Authentication-results: sourceware.org; auth=none
- References: <5271A321 dot 2000002 at ubuntu dot com> <87habx2xtj dot fsf at fleche dot redhat dot com> <CAH6eHdQRbazwJvBVuh+shj7NtvLUeMGOO2qFx7QueO_uWY+qxw at mail dot gmail dot com>
On 11 January 2014 19:19, Jonathan Wakely wrote:
> On 31 October 2013 16:46, Tom Tromey <email@example.com> wrote:
>>>>>>> "Matthias" == Matthias Klose <firstname.lastname@example.org> writes:
>> Matthias> Starting with gdb 7.6, gdb can be linked with both Python 2.x
>> Matthias> and Python 3.x. Therefore the pretty printers should be
>> Matthias> compatible with both Python versions.
>> Thanks for doing this.
>> Matthias> - n = self.rbiter.next()
>> Matthias> + n = next(self.rbiter)
>> Matthias> - def next(self):
>> Matthias> - item = self.rbiter.next()
>> Matthias> + def __next__(self):
>> Matthias> + item = next(self.rbiter)
>> Matthias> + return zip (counter, data)
>> I don't think these two hunks will work on Python 2.x.
>> But, I also don't think they are really needed, as I think it's just
>> fine to call the 'next' method on the iterator objects.
>> Matthias> +
>> Matthias> def display_hint (self):
>> Matthias> return 'map'
>> Spurious whitespace change?
>> You didn't say how you tested this. Did you run the libstdc++
>> pretty-printer tests?
> Matthias, did this patch get forgotten about?
> I'd like to see it go in, if Tom's concerns can be addressed.