Replace Incomplete | None = None in third party stubs (#14063)

This commit is contained in:
Sebastian Rittau
2025-05-15 21:37:43 +02:00
committed by GitHub
parent acc51542c9
commit 126768408a
488 changed files with 2259 additions and 4044 deletions
+12 -29
View File
@@ -22,7 +22,7 @@ class VBase:
behavior: Incomplete | None
parentBehavior: Incomplete | None
isNative: bool
def __init__(self, group: Incomplete | None = None) -> None: ...
def __init__(self, group=None) -> None: ...
def copy(self, copyit: VBase) -> None: ...
def validate(self, *args, **kwds) -> bool: ...
def getChildren(self) -> list[Incomplete]: ...
@@ -36,18 +36,10 @@ class VBase:
# Use Any because args and kwargs are passed to the behavior object
@overload
def serialize(
self,
buf: None = None,
lineLength: int = 75,
validate: bool = True,
behavior: Incomplete | None = None,
*args: Any,
**kwargs: Any,
self, buf: None = None, lineLength: int = 75, validate: bool = True, behavior=None, *args: Any, **kwargs: Any
) -> str: ...
@overload
def serialize(
self, buf: _W, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None, *args: Any, **kwargs: Any
) -> _W: ...
def serialize(self, buf: _W, lineLength: int = 75, validate: bool = True, behavior=None, *args: Any, **kwargs: Any) -> _W: ...
def toVName(name, stripNum: int = 0, upper: bool = False): ...
@@ -60,16 +52,7 @@ class ContentLine(VBase):
lineNumber: Incomplete
value: Incomplete
def __init__(
self,
name,
params,
value,
group: Incomplete | None = None,
encoded: bool = False,
isNative: bool = False,
lineNumber: Incomplete | None = None,
*args,
**kwds,
self, name, params, value, group=None, encoded: bool = False, isNative: bool = False, lineNumber=None, *args, **kwds
) -> None: ...
@classmethod
def duplicate(cls, copyit): ...
@@ -86,7 +69,7 @@ class Component(VBase):
contents: dict[str, list[VBase]]
name: Incomplete
useBegin: bool
def __init__(self, name: Incomplete | None = None, *args, **kwds) -> None: ...
def __init__(self, name=None, *args, **kwds) -> None: ...
@classmethod
def duplicate(cls, copyit): ...
def copy(self, copyit) -> None: ...
@@ -95,7 +78,7 @@ class Component(VBase):
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): ...
def getChildValue(self, childName, default=None, childNumber: int = 0): ...
@overload
def add(self, objOrName: _V, group: str | None = None) -> _V: ...
@overload
@@ -120,7 +103,7 @@ class Component(VBase):
class VObjectError(Exception):
msg: Incomplete
lineNumber: Incomplete
def __init__(self, msg, lineNumber: Incomplete | None = None) -> None: ...
def __init__(self, msg, lineNumber=None) -> None: ...
class ParseError(VObjectError): ...
class ValidateError(VObjectError): ...
@@ -133,14 +116,14 @@ line_re: Incomplete
begin_re: Incomplete
def parseParams(string): ...
def parseLine(line, lineNumber: Incomplete | None = None): ...
def parseLine(line, lineNumber=None): ...
wrap_re: Incomplete
logical_lines_re: Incomplete
testLines: str
def getLogicalLines(fp, allowQP: bool = True) -> None: ...
def textLineToContentLine(text, n: Incomplete | None = None): ...
def textLineToContentLine(text, n=None): ...
def dquoteEscape(param): ...
def foldOneLine(outbuf, input, lineLength: int = 75) -> None: ...
def defaultSerialize(obj, buf, lineLength): ...
@@ -158,7 +141,7 @@ def readComponents(
streamOrString, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False
) -> Iterator[Component]: ...
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 registerBehavior(behavior, name=None, default: bool = False, id=None) -> None: ...
def getBehavior(name, id=None): ...
def newFromBehavior(name, id=None): ...
def backslashEscape(s): ...
+1 -3
View File
@@ -1,8 +1,6 @@
from _typeshed import Incomplete
from .icalendar import VCalendar2_0
class HCalendar(VCalendar2_0):
name: str
@classmethod
def serialize(cls, obj, buf: Incomplete | None = None, lineLength: Incomplete | None = None, validate: bool = True): ...
def serialize(cls, obj, buf=None, lineLength=None, validate: bool = True): ...
+3 -3
View File
@@ -27,7 +27,7 @@ class TimezoneComponent(Component):
tzinfo: Incomplete
name: str
useBegin: bool
def __init__(self, tzinfo: Incomplete | None = None, *args, **kwds) -> None: ...
def __init__(self, tzinfo=None, *args, **kwds) -> None: ...
@classmethod
def registerTzinfo(cls, tzinfo): ...
def gettzinfo(self): ...
@@ -220,9 +220,9 @@ def stringToDateTime(s, tzinfo: datetime.tzinfo | None = None, strict: bool = Fa
escapableCharList: str
def stringToTextValues(s, listSeparator: str = ",", charList: Incomplete | None = None, strict: bool = False): ...
def stringToTextValues(s, listSeparator: str = ",", charList=None, strict: bool = False): ...
def stringToDurations(s, strict: bool = False): ...
def parseDtstart(contentline, allowSignatureMismatch: bool = False): ...
def stringToPeriod(s, tzinfo: Incomplete | None = None): ...
def stringToPeriod(s, tzinfo=None): ...
def getTransition(transitionTo, year, tzinfo): ...
def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = 2000, endYear: int = 2020): ...
+1 -1
View File
@@ -89,7 +89,7 @@ class Photo(VCardTextBehavior):
def toListOrString(string): ...
def splitFields(string): ...
def toList(stringOrList): ...
def serializeFields(obj, order: Incomplete | None = None): ...
def serializeFields(obj, order=None): ...
NAME_ORDER: Incomplete
ADDRESS_ORDER: Incomplete