티스토리 수익 글 보기

티스토리 수익 글 보기

Allow fromstring with buffer objects by jsonn · Pull Request #448 · lxml/lxml · GitHub
Skip to content

Allow fromstring with buffer objects – #448

Closed
jsonn wants to merge 1 commit into
lxml:masterfrom
jsonn:patch-2
Closed

Allow fromstring with buffer objects#448
jsonn wants to merge 1 commit into
lxml:masterfrom
jsonn:patch-2

Conversation

@jsonn

@jsonn jsonn commented Jan 27, 2025

Copy link
Copy Markdown

Database adapters like psycopg will use memoryview objects to represent binary strings. There is no need to force applications to copy the data to bytes manually as the logic already works fine for buffer objects. As such, just relax the type check.

Database adapters like psycopg will use memoryview objects to represent binary strings. There is no need to force applications to copy the data to bytes manually as the logic already works fine for buffer objects. As such, just relax the type check.
@scoder

scoder commented Jan 27, 2025 via email

Copy link
Copy Markdown
Member

@jsonn

jsonn commented Jan 27, 2025

Copy link
Copy Markdown
Author

AFAICT, memoryview is how the buffer interface is exposed as Python object at least in Python 3. In Py2, there was also “buffer”, but upstream lxml no longer has to care about that.

@scoder scoder closed this in b9e49d9 Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants