This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Access to "default GDB printer" from Python pretty printers?
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: archer at sourceware dot org
- Date: Wed, 5 Nov 2008 10:52:29 -0800
- Subject: Re: Access to "default GDB printer" from Python pretty printers?
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta;t=1225911152; bh=2yMgp4/bwYA+ITogo9hmXOfS8vQ=;h=DomainKey-Signature:MIME-Version:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding; b=ew31xDO/8B6OY4D6aGu06tW4leOZ2ehlfytigEA8xl0QT4eKI6dJ0N6pRvlC8tDpAiAslcT2u0a4DDVgRg9O+A==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns;h=mime-version:in-reply-to:references:date:message-id:subject:from:to:cc:content-type:content-transfer-encoding;b=sCdPJyGaN1t4g0VERAD8Y+eopJcC5TKPF4KqJxU7IfeE+Zg65K9j+VHBAz09ydJ/sIHic5Ucq1szr0ytQoWVDg==
- References: <20081105175721.C2DB73A6B0C@localhost> <m33ai6hv12.fsf@fleche.redhat.com>
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