Skip to content

Commit 67c7ad2

Browse files
committed
Fixed typing.overload
1 parent cb8cf03 commit 67c7ad2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

bson/binary.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import struct
1717
from dataclasses import dataclass
1818
from enum import Enum
19-
from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple, Type, Union
19+
from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple, Type, Union, overload
2020
from uuid import UUID
2121

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

400+
@classmethod
401+
@overload
402+
def from_vector(cls: Type[Binary], vector: BinaryVector) -> Binary:
403+
...
404+
405+
@classmethod
406+
@overload
407+
def from_vector(
408+
cls: Type[Binary], vector: list[int, float], dtype: BinaryVectorDtype, padding: int = 0
409+
) -> Binary:
410+
...
411+
400412
@classmethod
401413
def from_vector(
402414
cls: Type[Binary],

0 commit comments

Comments
 (0)