mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Enhance ZoneInfo.from_file stub (#14221)
Enhance ZoneInfo.from_file stub Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
# >= 3.12
|
||||
# =======
|
||||
|
||||
zoneinfo.ZoneInfo.from_file # Pos-only parameters had different "names" in different Python versions
|
||||
|
||||
# Initialized at runtime
|
||||
typing_extensions.TypeAliasType.__parameters__
|
||||
typing_extensions.TypeAliasType.__value__
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
# >= 3.12
|
||||
# =======
|
||||
|
||||
zoneinfo.ZoneInfo.from_file # Pos-only parameters had different "names" in different Python versions
|
||||
|
||||
# Initialized at runtime
|
||||
typing_extensions.TypeAliasType.__parameters__
|
||||
typing_extensions.TypeAliasType.__value__
|
||||
|
||||
@@ -50,8 +50,6 @@ functools.partialmethod.__new__
|
||||
# >= 3.12
|
||||
# =======
|
||||
|
||||
zoneinfo.ZoneInfo.from_file # Pos-only parameters had different "names" in different Python versions
|
||||
|
||||
# Types that require `__setattr__` and `__delattr__` for typing purposes:
|
||||
types.SimpleNamespace.__setattr__
|
||||
types.SimpleNamespace.__delattr__
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from collections.abc import Iterable
|
||||
from datetime import datetime, timedelta, tzinfo
|
||||
from typing_extensions import Self
|
||||
@@ -17,8 +18,13 @@ class ZoneInfo(tzinfo):
|
||||
def __new__(cls, key: str) -> Self: ...
|
||||
@classmethod
|
||||
def no_cache(cls, key: str) -> Self: ...
|
||||
@classmethod
|
||||
def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
@classmethod
|
||||
def from_file(cls, file_obj: _IOBytes, /, key: str | None = None) -> Self: ...
|
||||
else:
|
||||
@classmethod
|
||||
def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self: ...
|
||||
|
||||
@classmethod
|
||||
def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None: ...
|
||||
def tzname(self, dt: datetime | None, /) -> str | None: ...
|
||||
|
||||
Reference in New Issue
Block a user