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


Groups > comp.lang.python > #51679 > unrolled thread

Re: Problem with psycopg2, bytea, and memoryview

Started byTerry Reedy <tjreedy@udel.edu>
First post2013-07-31 13:59 -0400
Last post2013-07-31 13:59 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#51679 — Re: Problem with psycopg2, bytea, and memoryview

FromTerry Reedy <tjreedy@udel.edu>
Date2013-07-31 13:59 -0400
SubjectRe: Problem with psycopg2, bytea, and memoryview
Message-ID<mailman.43.1375293585.1251.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web