Skip to content

Commit 14474af

Browse files
authored
[datetime] Add missing default values (#14452)
1 parent 8a6075f commit 14474af

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

stdlib/datetime.pyi

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ class time:
118118
resolution: ClassVar[timedelta]
119119
def __new__(
120120
cls,
121-
hour: SupportsIndex = ...,
122-
minute: SupportsIndex = ...,
123-
second: SupportsIndex = ...,
124-
microsecond: SupportsIndex = ...,
125-
tzinfo: _TzInfo | None = ...,
121+
hour: SupportsIndex = 0,
122+
minute: SupportsIndex = 0,
123+
second: SupportsIndex = 0,
124+
microsecond: SupportsIndex = 0,
125+
tzinfo: _TzInfo | None = None,
126126
*,
127-
fold: int = ...,
127+
fold: int = 0,
128128
) -> Self: ...
129129
@property
130130
def hour(self) -> int: ...
@@ -144,7 +144,7 @@ class time:
144144
def __gt__(self, value: time, /) -> bool: ...
145145
def __eq__(self, value: object, /) -> bool: ...
146146
def __hash__(self) -> int: ...
147-
def isoformat(self, timespec: str = ...) -> str: ...
147+
def isoformat(self, timespec: str = "auto") -> str: ...
148148
@classmethod
149149
def fromisoformat(cls, time_string: str, /) -> Self: ...
150150

@@ -197,13 +197,13 @@ class timedelta:
197197
resolution: ClassVar[timedelta]
198198
def __new__(
199199
cls,
200-
days: float = ...,
201-
seconds: float = ...,
202-
microseconds: float = ...,
203-
milliseconds: float = ...,
204-
minutes: float = ...,
205-
hours: float = ...,
206-
weeks: float = ...,
200+
days: float = 0,
201+
seconds: float = 0,
202+
microseconds: float = 0,
203+
milliseconds: float = 0,
204+
minutes: float = 0,
205+
hours: float = 0,
206+
weeks: float = 0,
207207
) -> Self: ...
208208
@property
209209
def days(self) -> int: ...
@@ -247,13 +247,13 @@ class datetime(date):
247247
year: SupportsIndex,
248248
month: SupportsIndex,
249249
day: SupportsIndex,
250-
hour: SupportsIndex = ...,
251-
minute: SupportsIndex = ...,
252-
second: SupportsIndex = ...,
253-
microsecond: SupportsIndex = ...,
254-
tzinfo: _TzInfo | None = ...,
250+
hour: SupportsIndex = 0,
251+
minute: SupportsIndex = 0,
252+
second: SupportsIndex = 0,
253+
microsecond: SupportsIndex = 0,
254+
tzinfo: _TzInfo | None = None,
255255
*,
256-
fold: int = ...,
256+
fold: int = 0,
257257
) -> Self: ...
258258
@property
259259
def hour(self) -> int: ...
@@ -272,10 +272,10 @@ class datetime(date):
272272
# meaning it is only *safe* to pass it as a keyword argument on 3.12+
273273
if sys.version_info >= (3, 12):
274274
@classmethod
275-
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ...
275+
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = None) -> Self: ...
276276
else:
277277
@classmethod
278-
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = ...) -> Self: ...
278+
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = None) -> Self: ...
279279

280280
@classmethod
281281
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)")
@@ -321,8 +321,8 @@ class datetime(date):
321321
*,
322322
fold: int = ...,
323323
) -> Self: ...
324-
def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...
325-
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
324+
def astimezone(self, tz: _TzInfo | None = None) -> Self: ...
325+
def isoformat(self, sep: str = "T", timespec: str = "auto") -> str: ...
326326
@classmethod
327327
def strptime(cls, date_string: str, format: str, /) -> Self: ...
328328
def utcoffset(self) -> timedelta | None: ...

0 commit comments

Comments
 (0)