Skip to content

Commit 3e76afe

Browse files
authored
[tempfile] Deprecate mktemp function (#14433)
1 parent 1b87479 commit 3e76afe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/tempfile.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ from _typeshed import (
1515
from collections.abc import Iterable, Iterator
1616
from types import GenericAlias, TracebackType
1717
from typing import IO, Any, AnyStr, Generic, Literal, overload
18-
from typing_extensions import Self
18+
from typing_extensions import Self, deprecated
1919

2020
__all__ = [
2121
"NamedTemporaryFile",
@@ -471,6 +471,7 @@ def mkstemp(
471471
def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ...
472472
@overload
473473
def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ...
474+
@deprecated("Deprecated since Python 2.3. Use `mkstemp()` or `NamedTemporaryFile(delete=False)` instead.")
474475
def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ...
475476
def gettempdirb() -> bytes: ...
476477
def gettempprefixb() -> bytes: ...

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy