Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion bson/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import struct
from dataclasses import dataclass
from enum import Enum
from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple, Type, Union
from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple, Type, Union, overload
from uuid import UUID

"""Tools for representing BSON binary data.
Expand Down Expand Up @@ -397,6 +397,18 @@ def as_uuid(self, uuid_representation: int = UuidRepresentation.STANDARD) -> UUI
f"cannot decode subtype {self.subtype} to {UUID_REPRESENTATION_NAMES[uuid_representation]}"
)

@classmethod
@overload
def from_vector(cls: Type[Binary], vector: BinaryVector) -> Binary:
...

@classmethod
@overload
def from_vector(
cls: Type[Binary], vector: list[int, float], dtype: BinaryVectorDtype, padding: int = 0
) -> Binary:
...

@classmethod
def from_vector(
cls: Type[Binary],
Expand Down
Loading