mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
stdlib: more deprecations (#11009)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import sys
|
||||
from abc import abstractmethod
|
||||
from time import struct_time
|
||||
from typing import ClassVar, Literal, NamedTuple, NoReturn, SupportsIndex, TypeVar, final, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
from typing_extensions import Self, TypeAlias, deprecated
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR", "UTC")
|
||||
@@ -251,10 +251,12 @@ class datetime(date):
|
||||
def fromtimestamp(cls, __timestamp: float, tz: _TzInfo | None = ...) -> Self: ...
|
||||
|
||||
@classmethod
|
||||
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.UTC)")
|
||||
def utcfromtimestamp(cls, __t: float) -> Self: ...
|
||||
@classmethod
|
||||
def now(cls, tz: _TzInfo | None = None) -> Self: ...
|
||||
@classmethod
|
||||
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.UTC)")
|
||||
def utcnow(cls) -> Self: ...
|
||||
@classmethod
|
||||
def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user