Skip to content

change destination_db's type constraint in copy() method ? #138

Closed
@spyinx

Description

@spyinx

when i read code in copy() method, i found destination_db can be int type and works well, but the type constraint hints it can only be str or None:

>>> from valkey import Valkey
>>> r = Valkey(host="127.0.0.1", port=6888, password='xxxxx')
>>> r.copy("hello", "abc", 1, True)
True
>>> r.copy("hello", "abc", "1", True)
True

def copy(
self,
source: str,
destination: str,
destination_db: Union[str, None] = None,
replace: bool = False,
) -> ResponseT:

so, i think this can be changed like this:

destination_db: Optional[Union[int, str]] = None,
or 
destination_db: Union[int, str, None] = None,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions