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-beautifulsoup4; implementation_name=="cpython"
types-python-dateutil; implementation_name=="cpython" types-python-dateutil; implementation_name=="cpython"
types-requests; implementation_name=="cpython" types-requests; implementation_name=="cpython"
typing-extensions; implementation_name=="cpython"
tzdata tzdata
wheel wheel

View file

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