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


Groups > comp.lang.python > #67517

Re: how to get bytes from bytearray without copying

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!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.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'from:charset:iso-8859-2': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'valueerror:': 0.09; 'aggregation,': 0.16; 'behave': 0.16; 'copying.': 0.16; 'overridden': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'redundant': 0.16; 'simpson': 0.16; 'subclass': 0.16; 'subclassing': 0.16; 'writable': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'performing': 0.26; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'have,': 0.30; 'subject:from': 0.34; 'but': 0.35; 'there': 0.35; 'doing': 0.36; 'implement': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'then,': 0.60; 'charset:iso-8859-2': 0.64; 'received:93': 0.72; 'subject:get': 0.81; 'received:hr': 0.84; 'thing...': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Juraj Ivančić <juraj.ivancic@gmail.com>
Subject Re: how to get bytes from bytearray without copying
Date Mon, 03 Mar 2014 09:15:00 +0100
References <lf0h3g$m7r$1@ger.gmane.org> <20140303004458.GA73815@cskk.homeip.net>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 93-136-72-166.adsl.net.t-com.hr
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <20140303004458.GA73815@cskk.homeip.net>
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.7628.1393834521.18130.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393834521 news.xs4all.nl 2886 [2001:888:2000:d::a6]:53703
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67517

Show key headers only | View raw


On 3.3.2014. 1:44, Cameron Simpson wrote:

>> ValueError: cannot hash writable memoryview object
>
> Have you considered subclassing memoryview and giving the subclass
> a __hash__ method?

I have, and then, when I failed to subclass it, I considered doing 
aggregation, and make it behave byte-like. But how to implement the 
overridden __hash__ method? It will still require at least *some* 
redundant copying. And there is the slicing thing... the whole idea 
started to feel like I was performing tonsillectomy through the anal cavity.

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


Thread

Re: how to get bytes from bytearray without copying Juraj Ivančić <juraj.ivancic@gmail.com> - 2014-03-03 09:15 +0100

csiph-web