This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] make the libstdc++ pretty printers compatible with both Python 2 and Python3


>>>>> "Matthias" == Matthias Klose <doko@ubuntu.com> 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?

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]