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


Groups > comp.lang.python > #51679

Re: Problem with psycopg2, bytea, and memoryview

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Problem with psycopg2, bytea, and memoryview
Date 2013-07-31 13:59 -0400
References <ktam8i$hj3$1@ger.gmane.org> <loom.20130731T114936-455@post.gmane.org> <ktat7p$t70$1@ger.gmane.org> <loom.20130731T150154-520@post.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.43.1375293585.1251.python-list@python.org> (permalink)

Show all headers | View raw


On 7/31/2013 9:07 AM, Antoine Pitrou wrote:
> Frank Millman <frank <at> chagford.com> writes:
>>
>> Thanks for that, Antoine. It is an improvement over tobytes(), but i am
>> afraid it is still not ideal for my purposes.
>
> I would suggest asking the psycopg2 project why they made this choice, and
> if they would reconsider. Returning a memoryview doesn't make much sense IMHO.

I agree.
"memoryview objects allow Python code to access the internal data of an 
object that supports the buffer protocol without copying."
Example: the binary image data of an image object.
They are not intended to be a standalone objects when there is an 
obvious alternative (in this case, bytes).

-- 
Terry Jan Reedy

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


Thread

Re: Problem with psycopg2, bytea, and memoryview Terry Reedy <tjreedy@udel.edu> - 2013-07-31 13:59 -0400

csiph-web