mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-28 04:22:21 +08:00
Replace Any with Incomplete in many places (#9558)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from _typeshed import SupportsWrite
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import Any, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
@@ -19,7 +19,7 @@ class VBase:
|
||||
behavior: Any | None
|
||||
parentBehavior: Any | None
|
||||
isNative: bool
|
||||
def __init__(self, group: Any | None = ...) -> None: ...
|
||||
def __init__(self, group: Incomplete | None = ...) -> None: ...
|
||||
def copy(self, copyit: VBase) -> None: ...
|
||||
def validate(self, *args, **kwds) -> bool: ...
|
||||
def getChildren(self) -> list[Any]: ...
|
||||
@@ -31,9 +31,11 @@ class VBase:
|
||||
def transformChildrenToNative(self) -> None: ...
|
||||
def transformChildrenFromNative(self, clearBehavior: bool = ...) -> None: ...
|
||||
@overload
|
||||
def serialize(self, buf: None = ..., lineLength: int = ..., validate: bool = ..., behavior: Any | None = ...) -> str: ...
|
||||
def serialize(
|
||||
self, buf: None = ..., lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ...
|
||||
) -> str: ...
|
||||
@overload
|
||||
def serialize(self, buf: _W, lineLength: int = ..., validate: bool = ..., behavior: Any | None = ...) -> _W: ...
|
||||
def serialize(self, buf: _W, lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ...) -> _W: ...
|
||||
|
||||
def toVName(name, stripNum: int = ..., upper: bool = ...): ...
|
||||
|
||||
@@ -50,10 +52,10 @@ class ContentLine(VBase):
|
||||
name,
|
||||
params,
|
||||
value,
|
||||
group: Any | None = ...,
|
||||
group: Incomplete | None = ...,
|
||||
encoded: bool = ...,
|
||||
isNative: bool = ...,
|
||||
lineNumber: Any | None = ...,
|
||||
lineNumber: Incomplete | None = ...,
|
||||
*args,
|
||||
**kwds,
|
||||
) -> None: ...
|
||||
@@ -72,7 +74,7 @@ class Component(VBase):
|
||||
contents: dict[str, list[VBase]]
|
||||
name: Any
|
||||
useBegin: bool
|
||||
def __init__(self, name: Any | None = ..., *args, **kwds) -> None: ...
|
||||
def __init__(self, name: Incomplete | None = ..., *args, **kwds) -> None: ...
|
||||
@classmethod
|
||||
def duplicate(cls, copyit): ...
|
||||
def copy(self, copyit) -> None: ...
|
||||
@@ -81,7 +83,7 @@ class Component(VBase):
|
||||
normal_attributes: Any
|
||||
def __setattr__(self, name: str, value) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def getChildValue(self, childName, default: Any | None = ..., childNumber: int = ...): ...
|
||||
def getChildValue(self, childName, default: Incomplete | None = ..., childNumber: int = ...): ...
|
||||
@overload
|
||||
def add(self, objOrName: _V, group: str | None = ...) -> _V: ...
|
||||
@overload
|
||||
@@ -106,7 +108,7 @@ class Component(VBase):
|
||||
class VObjectError(Exception):
|
||||
msg: Any
|
||||
lineNumber: Any
|
||||
def __init__(self, msg, lineNumber: Any | None = ...) -> None: ...
|
||||
def __init__(self, msg, lineNumber: Incomplete | None = ...) -> None: ...
|
||||
|
||||
class ParseError(VObjectError): ...
|
||||
class ValidateError(VObjectError): ...
|
||||
@@ -119,14 +121,14 @@ line_re: Any
|
||||
begin_re: Any
|
||||
|
||||
def parseParams(string): ...
|
||||
def parseLine(line, lineNumber: Any | None = ...): ...
|
||||
def parseLine(line, lineNumber: Incomplete | None = ...): ...
|
||||
|
||||
wrap_re: Any
|
||||
logical_lines_re: Any
|
||||
testLines: str
|
||||
|
||||
def getLogicalLines(fp, allowQP: bool = ...) -> None: ...
|
||||
def textLineToContentLine(text, n: Any | None = ...): ...
|
||||
def textLineToContentLine(text, n: Incomplete | None = ...): ...
|
||||
def dquoteEscape(param): ...
|
||||
def foldOneLine(outbuf, input, lineLength: int = ...) -> None: ...
|
||||
def defaultSerialize(obj, buf, lineLength): ...
|
||||
@@ -144,7 +146,7 @@ def readComponents(
|
||||
streamOrString, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ...
|
||||
) -> Iterator[Component]: ...
|
||||
def readOne(stream, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ...): ...
|
||||
def registerBehavior(behavior, name: Any | None = ..., default: bool = ..., id: Any | None = ...) -> None: ...
|
||||
def getBehavior(name, id: Any | None = ...): ...
|
||||
def newFromBehavior(name, id: Any | None = ...): ...
|
||||
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 backslashEscape(s): ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Any
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .icalendar import VCalendar2_0
|
||||
|
||||
class HCalendar(VCalendar2_0):
|
||||
name: str
|
||||
@classmethod
|
||||
def serialize(cls, obj, buf: Any | None = ..., lineLength: Any | None = ..., validate: bool = ...): ...
|
||||
def serialize(cls, obj, buf: Incomplete | None = ..., lineLength: Incomplete | None = ..., validate: bool = ...): ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from datetime import timedelta
|
||||
from typing import Any
|
||||
|
||||
@@ -25,7 +26,7 @@ class TimezoneComponent(Component):
|
||||
tzinfo: Any
|
||||
name: str
|
||||
useBegin: bool
|
||||
def __init__(self, tzinfo: Any | None = ..., *args, **kwds) -> None: ...
|
||||
def __init__(self, tzinfo: Incomplete | None = ..., *args, **kwds) -> None: ...
|
||||
@classmethod
|
||||
def registerTzinfo(cls, tzinfo): ...
|
||||
def gettzinfo(self): ...
|
||||
@@ -224,13 +225,13 @@ def deltaToOffset(delta): ...
|
||||
def periodToString(period, convertToUTC: bool = ...): ...
|
||||
def isDuration(s): ...
|
||||
def stringToDate(s): ...
|
||||
def stringToDateTime(s, tzinfo: Any | None = ...): ...
|
||||
def stringToDateTime(s, tzinfo: Incomplete | None = ...): ...
|
||||
|
||||
escapableCharList: str
|
||||
|
||||
def stringToTextValues(s, listSeparator: str = ..., charList: Any | None = ..., strict: bool = ...): ...
|
||||
def stringToTextValues(s, listSeparator: str = ..., charList: Incomplete | None = ..., strict: bool = ...): ...
|
||||
def stringToDurations(s, strict: bool = ...): ...
|
||||
def parseDtstart(contentline, allowSignatureMismatch: bool = ...): ...
|
||||
def stringToPeriod(s, tzinfo: Any | None = ...): ...
|
||||
def stringToPeriod(s, tzinfo: Incomplete | None = ...): ...
|
||||
def getTransition(transitionTo, year, tzinfo): ...
|
||||
def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = ..., endYear: int = ...): ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
from .behavior import Behavior
|
||||
@@ -83,7 +84,7 @@ class Photo(VCardTextBehavior):
|
||||
def toListOrString(string): ...
|
||||
def splitFields(string): ...
|
||||
def toList(stringOrList): ...
|
||||
def serializeFields(obj, order: Any | None = ...): ...
|
||||
def serializeFields(obj, order: Incomplete | None = ...): ...
|
||||
|
||||
NAME_ORDER: Any
|
||||
ADDRESS_ORDER: Any
|
||||
|
||||
Reference in New Issue
Block a user