This is the mail archive of the
mailing list for the Archer project.
Re: [python][rfc] Attempt to print the base class if a there is no Python pretty-printer for a derived class.
- From: Pedro Alves <alves dot ped at gmail dot com>
- To: archer at sourceware dot org
- Cc: Phil Muldoon <pmuldoon at redhat dot com>
- Date: Fri, 27 Mar 2009 17:43:10 +0000
- Subject: Re: [python][rfc] Attempt to print the base class if a there is no Python pretty-printer for a derived class.
- References: <49CD0730.firstname.lastname@example.org>
On Friday 27 March 2009 17:04:48, Phil Muldoon wrote:
> The bug is detailed here:
> In summary, given this class:
> class Y : public std::tr1::unordered_map<int, char *>
> Any Python pretty-printers that have been written and registered to
> print std::tr1::unordered_map will not work on Y. But there is no
> reason, given the lack of a more specialized printer for Y, why the
> printer for unordered_map should not print the parts of Y it can
> accurately print. This patch attempts to find a base class printer if a
> specialized printer does not exist for the class in question.
I don't know a thing about python pretty-printing, so excuse any
silly questions, but, anyway...
Does this do sensible things if class Y has some
fields that mask the Base class's ones, when you only have a
pretty printer for Base? Say:
class Y : public Base
What about private inheritance, sometimes used as an implementation
detail, but not representing an is-a relationship?
class Y : private Base
// My API that has nothing to do with Base.
// my own data members