Skip to content

Commit

Permalink
Addressed comments in docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyclements committed Sep 16, 2024
1 parent 3d36aa9 commit e32d1b8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bson/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,13 @@ class UuidRepresentation:
class BinaryVectorDtype(Enum):
"""Datatypes of vector subtype.
FLOAT32: Pack floats as float32
INT8: Pack ints in [-128, 127] as signed int8
PACKED_BIT: Pack ints in [0, 255] as unsigned uint8
The PACKED_BIT value represents a special case where vector values themselves
can only hold two values (0 or 1) but these are packed together into groups of 8,
a byte. In Python, these are displayed as ints in range(0,128).
a byte. In Python, these are displayed as ints in range [0, 255]
"""

INT8 = b"\x03"
Expand Down Expand Up @@ -263,9 +267,11 @@ class Binary(bytes):
<https://bsonspec.org/spec.html>`_
to use
.. versionchanged::
3.9 Support any bytes-like type that implements the buffer protocol.
4.9 Addition of vector subtype.
.. versionchanged:: 3.9
Support any bytes-like type that implements the buffer protocol.
.. versionchanged:: 4.9
Addition of vector subtype.
"""

_type_marker = 5
Expand Down

0 comments on commit e32d1b8

Please sign in to comment.