Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62489

Re: bytearray inconsistencies?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!diablo1.news.osn.de!news.osn.de!diablo2.news.osn.de!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 <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; '128': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'language.': 0.14; 'bytearrays,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'separator.': 0.16; 'zero,': 0.16; 'all.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'split': 0.19; 'header:User- Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; "doesn't": 0.30; 'subject:skip:i 10': 0.31; 'up.': 0.33; 'sense': 0.34; "i'd": 0.34; 'but': 0.35; 'subject:?': 0.36; 'half': 0.37; 'two': 0.37; 'to:addr:python-list': 0.38; 'expect': 0.39; 'explain': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'simple': 0.61; 'our': 0.64; 'effectively': 0.66; 'cut': 0.74; 'batchelder': 0.84; 'promptly': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: bytearray inconsistencies?
Date Sat, 21 Dec 2013 12:29:14 +0000
References <l92phr$3b2$1@ger.gmane.org> <l92sju$ugd$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-78-147-30-118.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <l92sju$ugd$1@ger.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4469.1387628971.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1387628971 news.xs4all.nl 2849 [2001:888:2000:d::a6]:33864
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:62489

Show key headers only | View raw


On 21/12/2013 01:58, Ned Batchelder wrote:
>
> If you have a zero, you can split on it with:
> bytestring.split(bytes([0])), but that doesn't explain why find can take
> a simple zero, and split has to take a bytestring with a zero in it.
>

Create a bytearray(range(256)) and partition it on 128.  I'd expect to 
see the original effectively cut in half with 128 as the separator.  You 
actually get the original with two empty bytearrays, which makes no 
sense to me at all.

I also looked in test_bytes.py, read as far as "XXX This is a mess" and 
promptly gave up.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: bytearray inconsistencies? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 12:29 +0000
  Re: bytearray inconsistencies? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-21 13:13 +0000

csiph-web