Skip to content

gh-118469: Document sqlite3.Binary in module constants #136734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

killerdevildog
Copy link

@killerdevildog killerdevildog commented Jul 17, 2025

gh-118469: Add documentation for sqlite3.Binary

Documents sqlite3.Binary as a memoryview alias for handling BLOB data per DB-API 2.0 specification.

Key additions:

  • Explains Binary as memoryview alias for SQL BLOB values
  • Notes that bytes objects can also handle binary data directly
  • Includes cross-references to related types
  • Follows DB-API 2.0 specification requirements

Fixes gh-118469


📚 Documentation preview 📚: https://cpython-previews--136734.org.readthedocs.build/

@python-cla-bot
Copy link

python-cla-bot bot commented Jul 17, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@ZeroIntensity ZeroIntensity added topic-sqlite3 needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jul 17, 2025
.. data:: Binary

A type object used to describe columns containing :abbr:`BLOB (Binary Large OBject)` data.
Implemented as an alias for :class:`memoryview`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add "this is" to make it a complete sentence.
  2. Mention that is the current behavior; we can change it in the future.
Suggested change
Implemented as an alias for :class:`memoryview`.
This is currently implemented as an alias for :class:`memoryview`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not changed and a reason why was not given? I will mark as unresolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer if we leave out implementation details like this from the docs.


.. note::

Binary data can also be stored and retrieved using :class:`bytes` objects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should say that it can be done via bytes-like objects, not just bytes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link to the bytes-like glossary item.

- Remove redundant second paragraph about DB-API 2.0 specification
- Change 'bytes objects' to 'bytes-like objects' for accuracy
- Add 'This is the current behavior' to clarify implementation status
@killerdevildog killerdevildog force-pushed the doc-improvements-sqlite3-binary branch from c3d89c2 to 617a148 Compare July 17, 2025 16:10
killerdevildog and others added 3 commits July 17, 2025 11:39
Typo Fix

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Updated "This is " to make a complete sentence.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news topic-sqlite3
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

No documentation for sqlite3.Binary
4 participants