Add defaults to third-party stubs U-Z (#9971)

This commit is contained in:
Alex Waygood
2023-03-28 18:33:38 +01:00
committed by GitHub
parent 6b485a8823
commit ccc4b7a034
36 changed files with 233 additions and 229 deletions

View File

@@ -21,25 +21,25 @@ class VBase:
behavior: Incomplete | None
parentBehavior: Incomplete | None
isNative: bool
def __init__(self, group: Incomplete | None = ...) -> None: ...
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 clearBehavior(self, cascade: bool = ...) -> None: ...
def autoBehavior(self, cascade: bool = ...) -> None: ...
def setBehavior(self, behavior, cascade: bool = ...) -> None: ...
def clearBehavior(self, cascade: bool = True) -> None: ...
def autoBehavior(self, cascade: bool = False) -> None: ...
def setBehavior(self, behavior, cascade: bool = True) -> None: ...
def transformToNative(self): ...
def transformFromNative(self): ...
def transformChildrenToNative(self) -> None: ...
def transformChildrenFromNative(self, clearBehavior: bool = ...) -> None: ...
def transformChildrenFromNative(self, clearBehavior: bool = True) -> None: ...
@overload
def serialize(
self, buf: None = ..., lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ...
self, buf: None = None, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None
) -> str: ...
@overload
def serialize(self, buf: _W, lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ...) -> _W: ...
def serialize(self, buf: _W, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None) -> _W: ...
def toVName(name, stripNum: int = ..., upper: bool = ...): ...
def toVName(name, stripNum: int = 0, upper: bool = False): ...
class ContentLine(VBase):
name: Any
@@ -54,10 +54,10 @@ class ContentLine(VBase):
name,
params,
value,
group: Incomplete | None = ...,
encoded: bool = ...,
isNative: bool = ...,
lineNumber: Incomplete | None = ...,
group: Incomplete | None = None,
encoded: bool = False,
isNative: bool = False,
lineNumber: Incomplete | None = None,
*args,
**kwds,
) -> None: ...
@@ -70,13 +70,13 @@ class ContentLine(VBase):
def __delattr__(self, name: str) -> None: ...
def valueRepr(self): ...
def __unicode__(self) -> str: ...
def prettyPrint(self, level: int = ..., tabwidth: int = ...) -> None: ...
def prettyPrint(self, level: int = 0, tabwidth: int = 3) -> None: ...
class Component(VBase):
contents: dict[str, list[VBase]]
name: Any
useBegin: bool
def __init__(self, name: Incomplete | None = ..., *args, **kwds) -> None: ...
def __init__(self, name: Incomplete | None = None, *args, **kwds) -> None: ...
@classmethod
def duplicate(cls, copyit): ...
def copy(self, copyit) -> None: ...
@@ -85,17 +85,17 @@ class Component(VBase):
normal_attributes: Any
def __setattr__(self, name: str, value) -> None: ...
def __delattr__(self, name: str) -> None: ...
def getChildValue(self, childName, default: Incomplete | None = ..., childNumber: int = ...): ...
def getChildValue(self, childName, default: Incomplete | None = None, childNumber: int = 0): ...
@overload
def add(self, objOrName: _V, group: str | None = ...) -> _V: ...
def add(self, objOrName: _V, group: str | None = None) -> _V: ...
@overload
def add(self, objOrName: Literal["vevent"], group: str | None = ...) -> Component: ...
def add(self, objOrName: Literal["vevent"], group: str | None = None) -> Component: ...
@overload
def add(
self, objOrName: Literal["uid", "summary", "description", "dtstart", "dtend"], group: str | None = ...
self, objOrName: Literal["uid", "summary", "description", "dtstart", "dtend"], group: str | None = None
) -> ContentLine: ...
@overload
def add(self, objOrName: str, group: str | None = ...) -> Any: ... # returns VBase sub-class
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 components(self) -> Iterable[Component]: ...
@@ -104,13 +104,13 @@ class Component(VBase):
def getSortedChildren(self): ...
def setBehaviorFromVersionLine(self, versionLine) -> None: ...
def transformChildrenToNative(self) -> None: ...
def transformChildrenFromNative(self, clearBehavior: bool = ...) -> None: ...
def prettyPrint(self, level: int = ..., tabwidth: int = ...) -> None: ...
def transformChildrenFromNative(self, clearBehavior: bool = True) -> None: ...
def prettyPrint(self, level: int = 0, tabwidth: int = 3) -> None: ...
class VObjectError(Exception):
msg: Any
lineNumber: Any
def __init__(self, msg, lineNumber: Incomplete | None = ...) -> None: ...
def __init__(self, msg, lineNumber: Incomplete | None = None) -> None: ...
class ParseError(VObjectError): ...
class ValidateError(VObjectError): ...
@@ -123,16 +123,16 @@ line_re: Any
begin_re: Any
def parseParams(string): ...
def parseLine(line, lineNumber: Incomplete | None = ...): ...
def parseLine(line, lineNumber: Incomplete | None = None): ...
wrap_re: Any
logical_lines_re: Any
testLines: str
def getLogicalLines(fp, allowQP: bool = ...) -> None: ...
def textLineToContentLine(text, n: Incomplete | None = ...): ...
def getLogicalLines(fp, allowQP: bool = True) -> None: ...
def textLineToContentLine(text, n: Incomplete | None = None): ...
def dquoteEscape(param): ...
def foldOneLine(outbuf, input, lineLength: int = ...) -> None: ...
def foldOneLine(outbuf, input, lineLength: int = 75) -> None: ...
def defaultSerialize(obj, buf, lineLength): ...
class Stack:
@@ -145,10 +145,10 @@ class Stack:
def pop(self): ...
def readComponents(
streamOrString, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ...
streamOrString, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False
) -> Iterator[Component]: ...
def readOne(stream, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ...): ...
def registerBehavior(behavior, name: Incomplete | None = ..., default: bool = ..., id: Incomplete | None = ...) -> None: ...
def getBehavior(name, id: Incomplete | None = ...): ...
def newFromBehavior(name, id: Incomplete | None = ...): ...
def readOne(stream, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False): ...
def registerBehavior(behavior, name: Incomplete | None = None, default: bool = False, id: Incomplete | None = None) -> None: ...
def getBehavior(name, id: Incomplete | None = None): ...
def newFromBehavior(name, id: Incomplete | None = None): ...
def backslashEscape(s): ...

View File

@@ -13,7 +13,7 @@ class Behavior:
forceUTC: bool
sortFirst: Any
@classmethod
def validate(cls, obj, raiseException: bool = ..., complainUnrecognized: bool = ...): ...
def validate(cls, obj, raiseException: bool = False, complainUnrecognized: bool = False): ...
@classmethod
def lineValidate(cls, line, raiseException, complainUnrecognized): ...
@classmethod
@@ -27,6 +27,6 @@ class Behavior:
@classmethod
def generateImplicitParameters(cls, obj) -> None: ...
@classmethod
def serialize(cls, obj, buf, lineLength, validate: bool = ...): ...
def serialize(cls, obj, buf, lineLength, validate: bool = True): ...
@classmethod
def valueRepr(cls, line): ...

View File

@@ -1,4 +1,4 @@
def change_tz(cal, new_timezone, default, utc_only: bool = ..., utc_tz=...) -> None: ...
def change_tz(cal, new_timezone, default, utc_only: bool = False, utc_tz=...) -> None: ...
def main() -> None: ...
version: str

View File

@@ -5,4 +5,4 @@ from .icalendar import VCalendar2_0
class HCalendar(VCalendar2_0):
name: str
@classmethod
def serialize(cls, obj, buf: Incomplete | None = ..., lineLength: Incomplete | None = ..., validate: bool = ...): ...
def serialize(cls, obj, buf: Incomplete | None = None, lineLength: Incomplete | None = None, validate: bool = True): ...

View File

@@ -16,7 +16,7 @@ twoHours: timedelta
def toUnicode(s: str | bytes) -> str: ...
def registerTzid(tzid, tzinfo) -> None: ...
def getTzid(tzid, smart: bool = ...): ...
def getTzid(tzid, smart: bool = True): ...
utc: Any # dateutil.tz.tz.tzutc
@@ -26,23 +26,23 @@ class TimezoneComponent(Component):
tzinfo: Any
name: str
useBegin: bool
def __init__(self, tzinfo: Incomplete | None = ..., *args, **kwds) -> None: ...
def __init__(self, tzinfo: Incomplete | None = None, *args, **kwds) -> None: ...
@classmethod
def registerTzinfo(cls, tzinfo): ...
def gettzinfo(self): ...
tzid: Any
daylight: Any
standard: Any
def settzinfo(self, tzinfo, start: int = ..., end: int = ...): ...
def settzinfo(self, tzinfo, start: int = 2000, end: int = 2030): ...
normal_attributes: Any
@staticmethod
def pickTzid(tzinfo, allowUTC: bool = ...): ...
def pickTzid(tzinfo, allowUTC: bool = False): ...
def prettyPrint(self, level, tabwidth) -> None: ... # type: ignore[override]
class RecurringComponent(Component):
isNative: bool
def __init__(self, *args, **kwds) -> None: ...
def getrruleset(self, addRDate: bool = ...): ...
def getrruleset(self, addRDate: bool = False): ...
def setrruleset(self, rruleset): ...
rruleset: Any
def __setattr__(self, name, value) -> None: ...
@@ -110,7 +110,7 @@ class VCalendar2_0(VCalendarComponentBehavior):
@classmethod
def generateImplicitParameters(cls, obj) -> None: ...
@classmethod
def serialize(cls, obj, buf, lineLength, validate: bool = ...): ...
def serialize(cls, obj, buf, lineLength, validate: bool = True): ...
class VTimezone(VCalendarComponentBehavior):
name: str
@@ -220,18 +220,18 @@ def numToDigits(num, places): ...
def timedeltaToString(delta): ...
def timeToString(dateOrDateTime): ...
def dateToString(date): ...
def dateTimeToString(dateTime, convertToUTC: bool = ...): ...
def dateTimeToString(dateTime, convertToUTC: bool = False): ...
def deltaToOffset(delta): ...
def periodToString(period, convertToUTC: bool = ...): ...
def periodToString(period, convertToUTC: bool = False): ...
def isDuration(s): ...
def stringToDate(s): ...
def stringToDateTime(s, tzinfo: Incomplete | None = ...): ...
def stringToDateTime(s, tzinfo: Incomplete | None = None): ...
escapableCharList: str
def stringToTextValues(s, listSeparator: str = ..., charList: Incomplete | None = ..., strict: bool = ...): ...
def stringToDurations(s, strict: bool = ...): ...
def parseDtstart(contentline, allowSignatureMismatch: bool = ...): ...
def stringToPeriod(s, tzinfo: Incomplete | None = ...): ...
def stringToTextValues(s, listSeparator: str = ",", charList: Incomplete | None = None, strict: bool = False): ...
def stringToDurations(s, strict: bool = False): ...
def parseDtstart(contentline, allowSignatureMismatch: bool = False): ...
def stringToPeriod(s, tzinfo: Incomplete | None = None): ...
def getTransition(transitionTo, year, tzinfo): ...
def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = ..., endYear: int = ...): ...
def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = 2000, endYear: int = 2020): ...

View File

@@ -1,6 +1,6 @@
def getSortKey(component): ...
def sortByUID(components): ...
def deleteExtraneous(component, ignore_dtstamp: bool = ...) -> None: ...
def deleteExtraneous(component, ignore_dtstamp: bool = False) -> None: ...
def diff(left, right): ...
def prettyDiff(leftObj, rightObj) -> None: ...
def main() -> None: ...

View File

@@ -9,9 +9,7 @@ class Name:
additional: Any
prefix: Any
suffix: Any
def __init__(
self, family: str = ..., given: str = ..., additional: str = ..., prefix: str = ..., suffix: str = ...
) -> None: ...
def __init__(self, family: str = "", given: str = "", additional: str = "", prefix: str = "", suffix: str = "") -> None: ...
@staticmethod
def toString(val): ...
def __eq__(self, other): ...
@@ -26,16 +24,16 @@ class Address:
country: Any
def __init__(
self,
street: str = ...,
city: str = ...,
region: str = ...,
code: str = ...,
country: str = ...,
box: str = ...,
extended: str = ...,
street: str = "",
city: str = "",
region: str = "",
code: str = "",
country: str = "",
box: str = "",
extended: str = "",
) -> None: ...
@staticmethod
def toString(val, join_char: str = ...): ...
def toString(val, join_char: str = "\n"): ...
lines: Any
one_line: Any
def __eq__(self, other): ...
@@ -84,7 +82,7 @@ class Photo(VCardTextBehavior):
def toListOrString(string): ...
def splitFields(string): ...
def toList(stringOrList): ...
def serializeFields(obj, order: Incomplete | None = ...): ...
def serializeFields(obj, order: Incomplete | None = None): ...
NAME_ORDER: Any
ADDRESS_ORDER: Any