From c2a33373cf190897ffa2259110135d659cb3bf79 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 18 Dec 2024 18:59:50 +0100 Subject: [PATCH] [vobject] Replace `typing.Any` with `_typeshed.Incomplete` (#13265) --- stubs/vobject/vobject/base.pyi | 42 +++++++++++++-------------- stubs/vobject/vobject/behavior.pyi | 7 +++-- stubs/vobject/vobject/icalendar.pyi | 34 +++++++++++----------- stubs/vobject/vobject/vcard.pyi | 37 ++++++++++++------------ stubs/vobject/vobject/win32tz.pyi | 44 ++++++++++++++--------------- 5 files changed, 82 insertions(+), 82 deletions(-) diff --git a/stubs/vobject/vobject/base.pyi b/stubs/vobject/vobject/base.pyi index 03f21e087..11cc2cf30 100644 --- a/stubs/vobject/vobject/base.pyi +++ b/stubs/vobject/vobject/base.pyi @@ -25,7 +25,7 @@ class VBase: def __init__(self, group: Incomplete | None = None) -> None: ... def copy(self, copyit: VBase) -> None: ... def validate(self, *args, **kwds) -> bool: ... - def getChildren(self) -> list[Any]: ... + def getChildren(self) -> list[Incomplete]: ... def clearBehavior(self, cascade: bool = True) -> None: ... def autoBehavior(self, cascade: bool = False) -> None: ... def setBehavior(self, behavior, cascade: bool = True) -> None: ... @@ -52,13 +52,13 @@ class VBase: def toVName(name, stripNum: int = 0, upper: bool = False): ... class ContentLine(VBase): - name: Any - encoded: Any - params: Any - singletonparams: Any - isNative: Any - lineNumber: Any - value: Any + name: Incomplete + encoded: Incomplete + params: Incomplete + singletonparams: Incomplete + isNative: Incomplete + lineNumber: Incomplete + value: Incomplete def __init__( self, name, @@ -84,7 +84,7 @@ class ContentLine(VBase): class Component(VBase): contents: dict[str, list[VBase]] - name: Any + name: Incomplete useBegin: bool def __init__(self, name: Incomplete | None = None, *args, **kwds) -> None: ... @classmethod @@ -92,7 +92,7 @@ class Component(VBase): def copy(self, copyit) -> None: ... def setProfile(self, name) -> None: ... def __getattr__(self, name: str): ... - normal_attributes: Any + normal_attributes: Incomplete def __setattr__(self, name: str, value) -> None: ... def __delattr__(self, name: str) -> None: ... def getChildValue(self, childName, default: Incomplete | None = None, childNumber: int = 0): ... @@ -107,7 +107,7 @@ class Component(VBase): @overload def add(self, objOrName: str, group: str | None = None) -> Any: ... # returns VBase sub-class def remove(self, obj) -> None: ... - def getChildren(self) -> list[Any]: ... + def getChildren(self) -> list[Incomplete]: ... def components(self) -> Iterable[Component]: ... def lines(self): ... def sortChildKeys(self): ... @@ -118,25 +118,25 @@ class Component(VBase): def prettyPrint(self, level: int = 0, tabwidth: int = 3) -> None: ... class VObjectError(Exception): - msg: Any - lineNumber: Any + msg: Incomplete + lineNumber: Incomplete def __init__(self, msg, lineNumber: Incomplete | None = None) -> None: ... class ParseError(VObjectError): ... class ValidateError(VObjectError): ... class NativeError(VObjectError): ... -patterns: Any -param_values_re: Any -params_re: Any -line_re: Any -begin_re: Any +patterns: Incomplete +param_values_re: Incomplete +params_re: Incomplete +line_re: Incomplete +begin_re: Incomplete def parseParams(string): ... def parseLine(line, lineNumber: Incomplete | None = None): ... -wrap_re: Any -logical_lines_re: Any +wrap_re: Incomplete +logical_lines_re: Incomplete testLines: str def getLogicalLines(fp, allowQP: bool = True) -> None: ... @@ -146,7 +146,7 @@ def foldOneLine(outbuf, input, lineLength: int = 75) -> None: ... def defaultSerialize(obj, buf, lineLength): ... class Stack: - stack: Any + stack: Incomplete def __len__(self) -> int: ... def top(self): ... def topName(self): ... diff --git a/stubs/vobject/vobject/behavior.pyi b/stubs/vobject/vobject/behavior.pyi index 5db794b1a..3ca757bca 100644 --- a/stubs/vobject/vobject/behavior.pyi +++ b/stubs/vobject/vobject/behavior.pyi @@ -1,4 +1,5 @@ -from typing import Any, ClassVar +from _typeshed import Incomplete +from typing import ClassVar class Behavior: name: str @@ -6,12 +7,12 @@ class Behavior: versionString: str knownChildren: ClassVar[dict[str, tuple[int, int | None, int | None]]] quotedPrintable: bool - defaultBehavior: Any + defaultBehavior: Incomplete hasNative: bool isComponent: bool allowGroup: bool forceUTC: bool - sortFirst: Any + sortFirst: Incomplete @classmethod def validate(cls, obj, raiseException: bool = False, complainUnrecognized: bool = False): ... @classmethod diff --git a/stubs/vobject/vobject/icalendar.pyi b/stubs/vobject/vobject/icalendar.pyi index 1657cdb63..0071b6974 100644 --- a/stubs/vobject/vobject/icalendar.pyi +++ b/stubs/vobject/vobject/icalendar.pyi @@ -23,19 +23,19 @@ utc: Any # dateutil.tz.tz.tzutc class TimezoneComponent(Component): isNative: bool - behavior: Any - tzinfo: Any + behavior: Incomplete + tzinfo: Incomplete name: str useBegin: bool def __init__(self, tzinfo: Incomplete | None = None, *args, **kwds) -> None: ... @classmethod def registerTzinfo(cls, tzinfo): ... def gettzinfo(self): ... - tzid: Any - daylight: Any - standard: Any + tzid: Incomplete + daylight: Incomplete + standard: Incomplete def settzinfo(self, tzinfo, start: int = 2000, end: int = 2030): ... - normal_attributes: Any + normal_attributes: Incomplete @staticmethod def pickTzid(tzinfo, allowUTC: bool = False): ... def prettyPrint(self, level, tabwidth) -> None: ... # type: ignore[override] @@ -45,7 +45,7 @@ class RecurringComponent(Component): def __init__(self, *args, **kwds) -> None: ... def getrruleset(self, addRDate: bool = False): ... def setrruleset(self, rruleset): ... - rruleset: Any + rruleset: Incomplete def __setattr__(self, name, value) -> None: ... class TextBehavior(Behavior): @@ -56,7 +56,7 @@ class TextBehavior(Behavior): def encode(cls, line) -> None: ... class VCalendarComponentBehavior(Behavior): - defaultBehavior: Any + defaultBehavior: Incomplete isComponent: bool class RecurringBehavior(VCalendarComponentBehavior): @@ -106,7 +106,7 @@ class VCalendar2_0(VCalendarComponentBehavior): name: str description: str versionString: str - sortFirst: Any + sortFirst: Incomplete @classmethod def generateImplicitParameters(cls, obj) -> None: ... @classmethod @@ -116,7 +116,7 @@ class VTimezone(VCalendarComponentBehavior): name: str hasNative: bool description: str - sortFirst: Any + sortFirst: Incomplete @classmethod def validate(cls, obj, raiseException, *args): ... @staticmethod @@ -131,7 +131,7 @@ class DaylightOrStandard(VCalendarComponentBehavior): class VEvent(RecurringBehavior): name: str - sortFirst: Any + sortFirst: Incomplete description: str @classmethod def validate(cls, obj, raiseException, *args): ... @@ -148,7 +148,7 @@ class VJournal(RecurringBehavior): class VFreeBusy(VCalendarComponentBehavior): name: str description: str - sortFirst: Any + sortFirst: Incomplete class VAlarm(VCalendarComponentBehavior): name: str @@ -161,13 +161,13 @@ class VAlarm(VCalendarComponentBehavior): class VAvailability(VCalendarComponentBehavior): name: str description: str - sortFirst: Any + sortFirst: Incomplete @classmethod def validate(cls, obj, raiseException, *args): ... class Available(RecurringBehavior): name: str - sortFirst: Any + sortFirst: Incomplete description: str @classmethod def validate(cls, obj, raiseException, *args): ... @@ -203,9 +203,9 @@ class FreeBusy(PeriodBehavior): class RRule(Behavior): ... -utcDateTimeList: Any -dateTimeOrDateList: Any -textList: Any +utcDateTimeList: Incomplete +dateTimeOrDateList: Incomplete +textList: Incomplete def numToDigits(num, places): ... def timedeltaToString(delta): ... diff --git a/stubs/vobject/vobject/vcard.pyi b/stubs/vobject/vobject/vcard.pyi index c1d9be534..e5ef420bc 100644 --- a/stubs/vobject/vobject/vcard.pyi +++ b/stubs/vobject/vobject/vcard.pyi @@ -1,27 +1,26 @@ from _typeshed import Incomplete -from typing import Any from .behavior import Behavior class Name: - family: Any - given: Any - additional: Any - prefix: Any - suffix: Any + family: Incomplete + given: Incomplete + additional: Incomplete + prefix: Incomplete + suffix: Incomplete def __init__(self, family: str = "", given: str = "", additional: str = "", prefix: str = "", suffix: str = "") -> None: ... @staticmethod def toString(val): ... def __eq__(self, other): ... class Address: - box: Any - extended: Any - street: Any - city: Any - region: Any - code: Any - country: Any + box: Incomplete + extended: Incomplete + street: Incomplete + city: Incomplete + region: Incomplete + code: Incomplete + country: Incomplete def __init__( self, street: str = "", @@ -34,8 +33,8 @@ class Address: ) -> None: ... @staticmethod def toString(val, join_char: str = "\n"): ... - lines: Any - one_line: Any + lines: Incomplete + one_line: Incomplete def __eq__(self, other): ... class VCardTextBehavior(Behavior): @@ -48,14 +47,14 @@ class VCardTextBehavior(Behavior): class VCardBehavior(Behavior): allowGroup: bool - defaultBehavior: Any + defaultBehavior: Incomplete class VCard3_0(VCardBehavior): name: str description: str versionString: str isComponent: bool - sortFirst: Any + sortFirst: Incomplete @classmethod def generateImplicitParameters(cls, obj) -> None: ... @@ -85,8 +84,8 @@ def splitFields(string): ... def toList(stringOrList): ... def serializeFields(obj, order: Incomplete | None = None): ... -NAME_ORDER: Any -ADDRESS_ORDER: Any +NAME_ORDER: Incomplete +ADDRESS_ORDER: Incomplete class NameBehavior(VCardBehavior): hasNative: bool diff --git a/stubs/vobject/vobject/win32tz.pyi b/stubs/vobject/vobject/win32tz.pyi index 32936fbe5..1cf86d5f1 100644 --- a/stubs/vobject/vobject/win32tz.pyi +++ b/stubs/vobject/vobject/win32tz.pyi @@ -1,17 +1,17 @@ import datetime import sys -from typing import Any +from _typeshed import Incomplete if sys.platform == "win32": - handle: Any - tzparent: Any - parentsize: Any - localkey: Any - WEEKS: Any + handle: Incomplete + tzparent: Incomplete + parentsize: Incomplete + localkey: Incomplete + WEEKS: Incomplete def list_timezones(): ... class win32tz(datetime.tzinfo): - data: Any + data: Incomplete def __init__(self, name) -> None: ... def utcoffset(self, dt): ... def dst(self, dt): ... @@ -20,21 +20,21 @@ if sys.platform == "win32": def pickNthWeekday(year, month, dayofweek, hour, minute, whichweek): ... class win32tz_data: - display: Any - dstname: Any - stdname: Any - stdoffset: Any - dstoffset: Any - stdmonth: Any - stddayofweek: Any - stdweeknumber: Any - stdhour: Any - stdminute: Any - dstmonth: Any - dstdayofweek: Any - dstweeknumber: Any - dsthour: Any - dstminute: Any + display: Incomplete + dstname: Incomplete + stdname: Incomplete + stdoffset: Incomplete + dstoffset: Incomplete + stdmonth: Incomplete + stddayofweek: Incomplete + stdweeknumber: Incomplete + stdhour: Incomplete + stdminute: Incomplete + dstmonth: Incomplete + dstdayofweek: Incomplete + dstweeknumber: Incomplete + dsthour: Incomplete + dstminute: Incomplete def __init__(self, path) -> None: ... def valuesToDict(key): ...