Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.06; 'method.': 0.07; 'bytes.': 0.09; 'indeed,': 0.09; 'cc:addr:python- list': 0.11; 'jan': 0.12; ':-(': 0.16; 'dump': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hex': 0.16; 'subject:More': 0.16; 'subject:Unicode': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; '>>>': 0.22; 'putting': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; '2.x': 0.24; 'byte': 0.24; 'bytes': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'tim': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'easier': 0.31; '>>>>': 0.31; 'chase': 0.31; 'subject:About': 0.31; 'problem': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'turn': 0.37; 'little': 0.38; 'space': 0.40; 'subject:"': 0.60; 'new': 0.61; 'such': 0.63; 'between': 0.67; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=sZcxcbYbmlOdI3DZy/Uh89OZDMzQWxUwxB2sVbu4XBs=; b=nzYSqwroP2AL7ZcGcifh7CgIfxtlQeNVXHnvPCf4Vq1IID7E1gbE2KHjw7bUkms9EK gee5aJh0PWGofOYV2nqf7XCrkJ+/2chPQ0guN/8BLDEmwpAEWaoxB7TsxhWq+vNygVB+ XKlRtgVF/al6nzm79eberDN4mummQPjhiRiVCdqJyNpQGjYI8p50De9+QQF+Gqy6HwP6 LI2TXf/DlsAX/5wFyUJ1lB2hfAFt1o8hSWuDXHKf/IQhM5MBFvdN7koVyn7oa0i1sYy0 NM41LMPljnXWpNFmurYr0/w4KptUZ90QQ2lg3Zx9DTiyFPTLGC4YvyQugyG5NcRGWzvC LSDA== MIME-Version: 1.0 X-Received: by 10.68.162.66 with SMTP id xy2mr10592813pbb.46.1389049561853; Mon, 06 Jan 2014 15:06:01 -0800 (PST) In-Reply-To: <20140106144218.225787b3@bigbox.christie.dr> References: <52CA13BD.4050708@stoneleaf.us> <20140106144218.225787b3@bigbox.christie.dr> Date: Tue, 7 Jan 2014 10:06:01 +1100 Subject: Re: "More About Unicode in Python 2 and 3" From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389049571 news.xs4all.nl 2965 [2001:888:2000:d::a6]:32978 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63370 On Tue, Jan 7, 2014 at 7:42 AM, Tim Chase wrote: > On 2014-01-06 22:20, Serhiy Storchaka wrote: >> >>>> data = b"\x43\x6c\x67\x75\x62\x61" # is there an easier way to >> >>>> turn a hex dump into a bytes literal? >> >> >>> bytes.fromhex('43 6c 67 75 62 61') >> b'Clguba' > > Very nice new functionality in Py3k, but 2.x doesn't seem to have such > a method. :-( Thanks, Serhiy. Very nice new functionality indeed, and not having it in 2.x isn't a problem to me. That's exactly what I was looking for - it doesn't insist on (or complain about) separators between bytes. (Though the error from putting a space _inside_ a byte is a little confusing. But that's trivial.) ChrisA