Re: [PATCH] test: Make gen-threads work with python3
authorW. Trevor King <wking@tremily.us>
Fri, 31 Oct 2014 17:41:54 +0000 (10:41 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:05:58 +0000 (10:05 -0800)
92/58866e298b377756e6e5317de5382a8b5b717d [new file with mode: 0644]

diff --git a/92/58866e298b377756e6e5317de5382a8b5b717d b/92/58866e298b377756e6e5317de5382a8b5b717d
new file mode 100644 (file)
index 0000000..1d44550
--- /dev/null
@@ -0,0 +1,153 @@
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0B87C431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 31 Oct 2014 10:52:28 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.1\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id koG9-Oa921tT for <notmuch@notmuchmail.org>;\r
+       Fri, 31 Oct 2014 10:52:20 -0700 (PDT)\r
+Received: from resqmta-po-12v.sys.comcast.net (resqmta-po-12v.sys.comcast.net\r
+       [96.114.154.171])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 2D14D431FAF\r
+       for <notmuch@notmuchmail.org>; Fri, 31 Oct 2014 10:52:20 -0700 (PDT)\r
+Received: from resomta-po-02v.sys.comcast.net ([96.114.154.226])\r
+       by resqmta-po-12v.sys.comcast.net with comcast\r
+       id 9tqZ1p0024tLnxL01tsJle; Fri, 31 Oct 2014 17:52:18 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+       by resomta-po-02v.sys.comcast.net with comcast\r
+       id 9thv1p00Q152l3L01ti3Xl; Fri, 31 Oct 2014 17:42:12 +0000\r
+Received: by odin.tremily.us (Postfix, from userid 1000)\r
+       id 3CD211440A7F; Fri, 31 Oct 2014 10:41:54 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;\r
+       t=1414777314; bh=Lutqs67YYHlAbTVAM2EYRXM3FafEluZlR2k48xZ1Q1U=;\r
+       h=Date:From:To:Cc:Subject:References:In-Reply-To;\r
+       b=DrisrplZj20MsSXDXeBr13AsOIe/ayIhIEY1saJRyuUQY15e/L+soFz3ERLQKAUy3\r
+       88wk4kGKjQRWhm1zWhQXW6wgBfFLCpti/QOBOimHfoVWHDfHlBmN89AeKXbPQj4Msr\r
+       HN5ekoEf4Q2a/uqPOlep+gKSzAn81wBYcmeINgwo=\r
+Date: Fri, 31 Oct 2014 10:41:54 -0700\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: Jesse Rosenthal <jrosenthal@jhu.edu>\r
+Subject: Re: [PATCH] test: Make gen-threads work with python3\r
+Message-ID: <20141031174153.GQ15443@odin.tremily.us>\r
+References: <1414776805-30000-1-git-send-email-jrosenthal@jhu.edu>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+       protocol="application/pgp-signature"; boundary="1ysCV03AuJYXZqZy"\r
+Content-Disposition: inline\r
+In-Reply-To: <1414776805-30000-1-git-send-email-jrosenthal@jhu.edu>\r
+OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8;\r
+       url=http://tremily.us/pubkey.txt\r
+User-Agent: Mutt/1.5.23 (2014-03-12)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+       s=q20140121; t=1414777938;\r
+       bh=4sWcCrYS40AKzwEe2xDTg9efvrUgPgVc8ZBUWnfqLi4=;\r
+       h=Received:Received:Received:Date:From:To:Subject:Message-ID:\r
+       MIME-Version:Content-Type;\r
+       b=XYc565AnV+Vcl0EKK4zPuJVvDo7f2pm+q43iSCfnf32UkT01W1SclqhTCNiaS2+bb\r
+       sIUOI5gVIOXPxOntN7Uf21XGf28jS+njThqm9KwX+/AchqQmU8m3OHy9kfcI20NmuK\r
+       dDwUwgbI4G5R0xtf/lkSNFJABXJYCU9yMNwIdujR1xiExNNqKcQxm8imC3Te6C8ZEx\r
+       +FUxw/JJ1vwjYXcQO2njjuu7r70r5x3BHLygDLRJR4o/OAfbCDnGoRJRc65xzoBO4E\r
+       YXkaUvjiqDPw/mpAa6KdTJSAA18rElnTrelCGkKwg4H8Z/lWj4o05RwEmvm+CUfzEa\r
+       k1Buk9Tf8w1zw==\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 31 Oct 2014 17:52:28 -0000\r
+\r
+\r
+--1ysCV03AuJYXZqZy\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Fri, Oct 31, 2014 at 01:33:25PM -0400, Jesse Rosenthal wrote:\r
+> We instead initalize the dictionary using the dict comprehension and\r
+> then update it with the values from the tree. This will work with\r
+> both python2 and python3.\r
+\r
+Dict comprehensions are new in 2.7 [1,2], so this drops support for\r
+systems where =E2=80=98python=E2=80=99 means =E2=80=98python2.6=E2=80=99.  =\r
+Personally, I'm fine with\r
+that, but I thought I'd point it out in case 2.6 users wanted to push\r
+back ;).\r
+\r
+> diff --git a/test/gen-threads.py b/test/gen-threads.py\r
+> index 9fbb847..70fb1f6 100644\r
+> --- a/test/gen-threads.py\r
+> +++ b/test/gen-threads.py\r
+> @@ -2,7 +2,6 @@\r
+>  # argv[1].  Each output line is a thread structure, where the n'th\r
+>  # field is either a number giving the parent of message n or "None"\r
+>  # for the root.\r
+> -\r
+>  import sys\r
+\r
+Why remove this blank line?\r
+\r
+>  from itertools import chain, combinations\r
+> =20\r
+> @@ -28,6 +27,7 @@ while queue:\r
+>      else:\r
+>          # Expand node to_expand[0] with each possible set of children\r
+>          for children in subsets(free):\r
+> -            ntree =3D dict(tree, **{child: to_expand[0] for child in chi=\r
+ldren})\r
+> +            ntree =3D {child: to_expand[0] for child in children}\r
+> +            ntree.update(tree)\r
+\r
+This looks good to me.\r
+\r
+Cheers,\r
+Trevor\r
+\r
+[1]: https://docs.python.org/3/whatsnew/2.7.html#other-language-changes\r
+[2]: http://legacy.python.org/dev/peps/pep-0274/\r
+\r
+--=20\r
+This email may be signed or encrypted with GnuPG (http://www.gnupg.org).\r
+For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\r
+\r
+--1ysCV03AuJYXZqZy\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2\r
+\r
+iQIcBAEBAgAGBQJUU8nZAAoJEG8/JgBt8ol84FEQAOIXlvnkl0mReM3hkg6W4hvJ\r
+AOCdUjUtfE/UGV7SlYFZEuFBLDN4F73DcNvxilF37QaSFf+xoK9FRfMQ5lyPmQW2\r
+LV51axuXnAqCpHdgWAkurn8VB6KnzQE6nC97iv21ROYXewk3TFPHp9+ZM3+3JAz4\r
+PjFzcy7hGEKK9AOcS8X7C+SmaF6vZg+Bj+e9qJj1FAAsF9gWoHYOPzYWSdoOAJrG\r
+QI2Pm3vVm6wVRBZOgVshQKl5ZmuK/u2nQZ+8Kf57ttSmZ3D5J+mf1Ufj0sf3DkGo\r
+1umP4EuMcKiJLS8/iAY0wfwj+4qd+Nm5bCxxaRo3DYxWdHeIrvgE1lMnWRD36YzA\r
+0Xa4ZmL+B7L3zAuqorcRk87SXNQ6sgPEK7Q6azG9CSmbC7PBRFLaUtc6ANhc14Lf\r
+FEBusHfYAcACWOE8qfX85AxtshJuf3Y6f7DbXic2sJzVE3t/bkor5IuOy0xenq2/\r
+eNjenxGgfutE8fCB8abnX0iWha2BYzCqKg8qwlxmGRGk7XwIFqy9CWzAaBR5clHN\r
+FCCZ2aNZlz+F4xDgwbKXh7vlCfzCT3sQ2ZAGoRagbzql2vOOyl9qY0/GKZC2Vvn/\r
+ka7/y8kRvVl5V0zK7Pgjc75pHm00dqLYIp5McflD2eSaAHDnIATn+y9HHLvJMIAn\r
+K1ln76S+clh2Kb2L/82A\r
+=JwWQ\r
+-----END PGP SIGNATURE-----\r
+\r
+--1ysCV03AuJYXZqZy--\r