Skip to content

Commit

Permalink
Update shelve.open to support path-like objects
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed May 9, 2024
1 parent 72623c6 commit 18d2bc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stdlib/shelve.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from dbm import _TFlags
from types import TracebackType
from typing import Any, TypeVar, overload
from typing_extensions import Self
from _typeshed import StrOrBytesPath

__all__ = ["Shelf", "BsdDbShelf", "DbfilenameShelf", "open"]

Expand Down Expand Up @@ -41,6 +42,6 @@ class BsdDbShelf(Shelf[_VT]):
def last(self) -> tuple[str, _VT]: ...

class DbfilenameShelf(Shelf[_VT]):
def __init__(self, filename: str, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> None: ...
def __init__(self, filename: StrOrBytesPath, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> None: ...

def open(filename: str, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> Shelf[Any]: ...
def open(filename: StrOrBytesPath, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> Shelf[Any]: ...

0 comments on commit 18d2bc5

Please sign in to comment.