Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: base64.b64encode(data) Date: Tue, 14 Jun 2016 03:07:35 +1000 Lines: 13 Message-ID: References: <575e18f1$0$1588$c3e8da3$5496439d@news.astraweb.com> <1465788057.2854167.635655857.445F242C@webmail.messagingengine.com> <575e4198$0$1588$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de MnfOPLK+uUIapLT8UR3o4Ac3hZbOW+iX+e5aBLF9qpKA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:skip:b 10': 0.07; 'cc:addr:python-list': 0.09; 'behave': 0.09; 'bytes,': 0.09; 'high-level': 0.09; 'subclass': 0.09; 'python': 0.10; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:74.125.82.46': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'bytes': 0.18; 'case.': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'text,': 0.22; 'am,': 0.23; 'header :In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; '14,': 0.27; 'str': 0.29; 'strings,': 0.29; 'maybe': 0.33; 'point': 0.33; 'michael': 0.33; 'tue,': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'text.': 0.35; 'received:74.125.82': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'chrisa': 0.84; 'expect.': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=9vDiGv1Efgg3r4f5lNPApN6HQ046xw7ECU0qUxj8Yb8=; b=xSCKnbbXwJkfpjWFMB4Yu9rStGApqt8RC22y9UxWI5TnhUjbh/csaqekFSVDazRj9s KZIgQZ88IsvyNhTb9fAN903SErUViFMPUQIzkL8uOhWK+kOR8yvezzIiDidaE2TCM/4R arbg2HWUqgdJZIjSAh7Wyw4wIO5rSBxbPMwfFfVflVDkBDjRPwnV62ZgHEoiiJq5MRuy PwoULJByK8EOGvlmbnojqfUGd80g+yeBco1FtL97Qh9MVYdR1R+Le6iMKeGqKvAmdkZX QrRMRmK3UwH4Zy2Br6gBBv91GCpGMJMPRVkO0t3etvKxZkxdMhIr0eVYR/LwKChZ5H7Q XIDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=9vDiGv1Efgg3r4f5lNPApN6HQ046xw7ECU0qUxj8Yb8=; b=YSZ1mqJapd6TzZRndj0ENOD22Wd2yT8aMyDW6fLKqN176+Oi4n+MblpVFOI5OtLGfo RhZQz5T4jeDg6iSZS81J3He95lbz1sfrRMVpb53GQruT4o+cQ/YXv77Rf6AOw17TaBrY E/BJTyiw0giNUSwtUFGFwfGsV5hT7r3WQd+1I3MyC7rbYkGek5Vz6OUOUeuIHMgQD2Mj /gfRy6wA2x0tqxEDqGc+W5bq66AZxlYRNFYz8/i3IikGWt5xhnRbTsBvJRh3l6TwcyJX elOGdC+CBQHvhNykXE3g4CN5Te16tdzeT/yfeLaQv0ybCZee5XIne6Om3oQot4T4V4fr nKOg== X-Gm-Message-State: ALyK8tLUKBy58MXncYoirQpNttDGeMMxJURmdSpGgObVUa6860M+RJQ8B6B5nslnm1+iIEYpKTrdoUxnXXTBBA== X-Received: by 10.28.55.79 with SMTP id e76mr2200583wma.41.1465837656479; Mon, 13 Jun 2016 10:07:36 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <575e18f1$0$1588$c3e8da3$5496439d@news.astraweb.com> <1465788057.2854167.635655857.445F242C@webmail.messagingengine.com> <575e4198$0$1588$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:109905 On Tue, Jun 14, 2016 at 1:15 AM, Michael Torrie wrote: >> Looking at this from the high-level perspective of Python, that makes it >> conceptually bytes not text. > > I don't see how this is always the case. From a high-level python > perspective it's definitely text. That's the whole point of base64! Maybe what Python needs is an "ascii" type that's a subclass of both str and bytes, and requires that the contents be <0x80. It is text, so it can be combined with text strings; but it is also bytes, so when you combine it with bytes strings, it'll behave as most people expect. ChrisA