Merge pull request #149 from jepler/dunder_new_typing

WWVBMinute: correct typing of __new__ method
This commit is contained in:
Jeff Epler 2025-07-26 19:45:45 -05:00 committed by GitHub
commit 1f6dba6a59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -22,5 +22,6 @@ twine; implementation_name=="cpython"
types-beautifulsoup4; implementation_name=="cpython"
types-python-dateutil; implementation_name=="cpython"
types-requests; implementation_name=="cpython"
typing-extensions; implementation_name=="cpython"
tzdata
wheel

View file

@ -21,6 +21,8 @@ import json
import warnings
from typing import TYPE_CHECKING, Any, NamedTuple, TextIO, TypeVar
from typing_extensions import Self
from . import iersdata
from .tz import Mountain
@ -376,7 +378,7 @@ class WWVBMinute(_WWVBMinute):
epoch: int = 1970
def __new__( # noqa: PYI034
def __new__(
cls,
year: int,
days: int,
@ -387,7 +389,7 @@ class WWVBMinute(_WWVBMinute):
*,
ls: bool | None = None,
ly: bool | None = None,
) -> WWVBMinute:
) -> Self:
"""Construct a WWVBMinute
:param year: The 2- or 4-digit year. This parameter is converted by the `full_year` method.