From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51613 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODiQ9-0001hT-PG for qemu-devel@nongnu.org; Sun, 16 May 2010 14:18:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODiBD-0001vH-3k for qemu-devel@nongnu.org; Sun, 16 May 2010 14:03:12 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:38620) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODiBC-0001v6-PO for qemu-devel@nongnu.org; Sun, 16 May 2010 14:03:11 -0400 Message-ID: <4BF03358.4050609@web.de> Date: Sun, 16 May 2010 20:03:04 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <6e14cbfe3764b46d9bd6d2db61d41fd9c85dd54e.1273843151.git.jan.kiszka@siemens.com> <4BED9358.1000106@codemonkey.ws> <20100516173809.GA29814@shareable.org> In-Reply-To: <20100516173809.GA29814@shareable.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig382FE0B10B6D7658204EDECF" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 3/8] Add QBuffer List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Anthony Liguori , Juan Quintela , Markus Armbruster , qemu-devel@nongnu.org, Luiz Capitulino , Avi Kivity This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig382FE0B10B6D7658204EDECF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Jamie Lokier wrote: > Anthony Liguori wrote: >> Instead of encoding just as a string, it would be a good idea to encod= e=20 >> it as something like: >> >> {'__class__': 'base64', 'data': ...} >=20 > Is there a benefit to the class indirection, over simply a keyword?: >=20 > {'__base64__': ...} >=20 > __class__ seems to suggest much more than it's being used for here. >=20 Depending on how sophisticated your parser is, you could directly push the result into an object of the proper type. And we can add more complex objects in the future that do not only consists of a single data key. Note that this extension is not just about encoding, it is about typecasting (dict -> custom type). Jan --------------enig382FE0B10B6D7658204EDECF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkvwM1wACgkQitSsb3rl5xRB/wCghmWLj7croz4rtyDzgmTtPt/d 2vMAn0DN4daEyv9D5j9JKA37WRZ+9spl =SmJm -----END PGP SIGNATURE----- --------------enig382FE0B10B6D7658204EDECF--