Update memoryview-related comments

Co-authored-by: Benedikt <wisp3rwind@posteo.eu>
This commit is contained in:
Adrian Sampson 2021-08-21 13:26:10 -04:00 committed by GitHub
parent fd81d65c4b
commit 8e163a6e3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -98,7 +98,7 @@ class Type(object):
https://docs.python.org/2/library/sqlite3.html#sqlite-and-python-types
Flexible fields have the type affinity `TEXT`. This means the
`sql_value` is either a `buffer`/`memoryview` or a `unicode` object`
`sql_value` is either a `memoryview` or a `unicode` object`
and the method must handle these in addition.
"""
if isinstance(sql_value, memoryview):

View file

@ -38,7 +38,7 @@ from beets.dbcore import types
import beets
# To use the SQLite "blob" type, it doesn't suffice to provide a byte
# string; SQLite treats that as encoded text. Wrapping it in a tells it
# string; SQLite treats that as encoded text. Wrapping it in a `memoryview` tells it
# that we actually mean non-text data.
BLOB_TYPE = memoryview