Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E8B51429E27 for ; Wed, 14 Dec 2011 04:52:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tizyarDxZEHz for ; Wed, 14 Dec 2011 04:52:06 -0800 (PST) Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4CA40429E26 for ; Wed, 14 Dec 2011 04:52:06 -0800 (PST) Received: from mail.jade-hamburg.de (unknown [85.183.11.228]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cryptobitch.de (Postfix) with ESMTPSA id D563E50F4A1 for ; Wed, 14 Dec 2011 13:52:04 +0100 (CET) Received: by mail.jade-hamburg.de (Postfix, from userid 401) id 027F9DF2A1; Wed, 14 Dec 2011 13:52:03 +0100 (CET) Received: from thinkbox.jade-hamburg.de (unknown [85.183.11.228]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: teythoon) by mail.jade-hamburg.de (Postfix) with ESMTPSA id 476F7DF29F; Wed, 14 Dec 2011 13:52:02 +0100 (CET) Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77) (envelope-from ) id 1RaoJV-0007br-5g; Wed, 14 Dec 2011 13:52:01 +0100 Content-Type: multipart/mixed; boundary="===============6331577158138597432==" MIME-Version: 1.0 References: <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de> <1323860305-15802-4-git-send-email-4winter@informatik.uni-hamburg.de> To: Tomi Ollila , notmuch@notmuchmail.org In-Reply-To: From: Justus Winter <4winter@informatik.uni-hamburg.de> Subject: Re: [PATCH 3/7] py3k: All strings are unicode strings in py3k Date: Wed, 14 Dec 2011 13:52:01 +0100 Message-Id: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2011 12:52:07 -0000 --===============6331577158138597432== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Tomi :) Quoting Tomi Ollila (2011-12-14 13:17:41) >On Wed, 14 Dec 2011 11:58:21 +0100, Justus Winter <4winter@informatik.uni-= hamburg.de> wrote: >> --- >> bindings/python/notmuch/globals.py | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> = >> diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuc= h/globals.py >> index 54a49b2..99e6a10 100644 >> --- a/bindings/python/notmuch/globals.py >> +++ b/bindings/python/notmuch/globals.py >> @@ -51,7 +51,7 @@ class Status(Enum): >> """Get a (unicode) string representation of a notmuch_status_t = value.""" >> # define strings for custom error messages >> if status =3D=3D STATUS.NOT_INITIALIZED: >> - return u"Operation on uninitialized object impossible." >> + return "Operation on uninitialized object impossible." >> return unicode(Status._status2str(status)) >> = >> STATUS =3D Status(['SUCCESS', >> @@ -142,7 +142,7 @@ class NotmuchError(Exception): >> elif self.status is not None: >> return STATUS.status2str(self.status) >> else: >> - return u'Unknown error' >> + return 'Unknown error' > >Is this u -prefix unnecessary in python 2 too ? Grepping >'u"' and "u'" in **/*.py in puthon bindings source resulted >some more u-prefixed strings in docs/source/conf.py. Should >these be changed in some future patch ? Well, since the string literal contains no non-ascii characters it is perfectly safe to just use a (python2.x) string literal and it will be automatically coerced to unicode if it is used in a unicode context. OTOH it is possible to use from __future__ import unicode_literals to turn all string literals to unicode literals in python 2.x. Justus --===============6331577158138597432== Content-Type: application/octet-stream MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=".signature" bG92ZSB1IGFsb3QgQCxACgo= --===============6331577158138597432==--