This is the mail archive of the archer@sourceware.org mailing list for the Archer 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: Access to "default GDB printer" from Python pretty printers?


On Wed, Nov 5, 2008 at 10:44 AM, Tom Tromey <tromey@redhat.com> wrote:

> It occurs to me that we will be able to handle this case ok in the new
> unified style using delegation plus a special return result.

First, I'll admit that most of your "considering changes to
pretty-printing" message flew right over my head :-(

> Something like:
>
> class Print_sockaddr_un ...
> class Print_sockaddr_in ...
> class Print_sockaddr_in6 ...
>
> def Print_sockaddr(val):

Should that be

  class Print_sockaddr ...

>  if same as above
>    ...
>  else:
>    return None
>
> That is, rather than register a class constructor, we register a
> delegating "constructor" which decides what to do based on the value.
> If the constructor returns None, we'll just revert to the default.
>
> What do you think of this?

Sounds reasonable to me :)


-- 
Paul Pluzhnikov


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