From 359d4c095ddb3cc7a67f418a6685e1b094cb3825 Mon Sep 17 00:00:00 2001 From: Thomas M Kehrenberg Date: Tue, 7 Nov 2023 12:49:39 +0100 Subject: [PATCH] Fix return type of dbm.whichdb (#10989) It is `None` if the given file doesn't exist or isn't a database. --- stdlib/dbm/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/dbm/__init__.pyi b/stdlib/dbm/__init__.pyi index 0068d67b6..d71155288 100644 --- a/stdlib/dbm/__init__.pyi +++ b/stdlib/dbm/__init__.pyi @@ -90,5 +90,5 @@ class _error(Exception): ... error: tuple[type[_error], type[OSError]] -def whichdb(filename: str) -> str: ... +def whichdb(filename: str) -> str | None: ... def open(file: str, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ...