mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-08 13:05:14 +08:00
Update shelve.open and dbm.open to support path-like objects (#11881)
Closes #11856
This commit is contained in:
1 parent
ef42294f92
commit
5829e3bdea
5 files changed
+41
-9
No files matched your search
+5
-2
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import ReadOnlyBuffer
|
||||
from _typeshed import ReadOnlyBuffer, StrOrBytesPath
|
||||
from types import TracebackType
|
||||
from typing import TypeVar, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
@@ -34,4 +34,7 @@ if sys.platform != "win32":
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _dbm: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def open(filename: StrOrBytesPath, flags: str = "r", mode: int = 0o666, /) -> _dbm: ...
|
||||
else:
|
||||
def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _dbm: ...
|
||||
Reference in new issue
Block a user