diff --git a/src/zope-stubs/interface/__init__.pyi b/src/zope-stubs/interface/__init__.pyi index cf45985..093207a 100644 --- a/src/zope-stubs/interface/__init__.pyi +++ b/src/zope-stubs/interface/__init__.pyi @@ -1,10 +1,6 @@ -# Stubs for zope.interface (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from zope.interface.declarations import Declaration as Declaration, alsoProvides as alsoProvides, classImplements as classImplements, classImplementsOnly as classImplementsOnly, classProvides as classProvides, directlyProvidedBy as directlyProvidedBy, directlyProvides as directlyProvides, implementedBy as implementedBy, implementer as implementer, implementer_only as implementer_only, implements as implements, implementsOnly as implementsOnly, moduleProvides as moduleProvides, noLongerProvides as noLongerProvides, providedBy as providedBy, provider as provider, named as named +from zope.interface.declarations import Declaration as Declaration, alsoProvides as alsoProvides, classImplements as classImplements, classImplementsFirst as classImplementsFirst, classImplementsOnly as classImplementsOnly, directlyProvidedBy as directlyProvidedBy, directlyProvides as directlyProvides, implementedBy as implementedBy, implementer as implementer, implementer_only as implementer_only, moduleProvides as moduleProvides, noLongerProvides as noLongerProvides, providedBy as providedBy, provider as provider from zope.interface.interface import Attribute as Attribute, Interface as Interface, interfacemethod as interfacemethod, invariant as invariant, taggedValue as taggedValue -from zope.exceptions import Invalid as Invalid, DoesNotImplement as DoesNotImplement, BrokenImplementation as BrokenImplementation, InvalidInterface as InvalidInterface, BadImplements as BadImplements +from zope.interface.exceptions import Invalid as Invalid, DoesNotImplement as DoesNotImplement, BrokenImplementation as BrokenImplementation, Inval from zope.interface import adapter as adapter from zope.interface import advice as advice from zope.interface import interfaces as interfaces diff --git a/src/zope-stubs/interface/_compat.pyi b/src/zope-stubs/interface/_compat.pyi index 603053b..06bb0df 100644 --- a/src/zope-stubs/interface/_compat.pyi +++ b/src/zope-stubs/interface/_compat.pyi @@ -1,10 +1,3 @@ -# Stubs for zope.interface._compat (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from _typeshed import Incomplete -from typing import Any - -CLASS_TYPES: Any -STRING_TYPES: Any -PYTHON3: bool -PYTHON2: bool +PYPY: Incomplete diff --git a/src/zope-stubs/interface/_flatten.pyi b/src/zope-stubs/interface/_flatten.pyi index 79df364..a0d939b 100644 --- a/src/zope-stubs/interface/_flatten.pyi +++ b/src/zope-stubs/interface/_flatten.pyi @@ -1,4 +1 @@ -# Stubs for zope.interface._flatten (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - +from zope.interface import Declaration as Declaration diff --git a/src/zope-stubs/interface/_zope_interface_coptimizations.pyi b/src/zope-stubs/interface/_zope_interface_coptimizations.pyi index ca29fc9..943505c 100644 --- a/src/zope-stubs/interface/_zope_interface_coptimizations.pyi +++ b/src/zope-stubs/interface/_zope_interface_coptimizations.pyi @@ -1,27 +1,29 @@ -# Stubs for zope.interface._zope_interface_coptimizations (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - from typing import Any import _interface_coptimizations import _zope_interface_coptimizations -adapter_hooks: Any - -def getObjectSpecification(*args, **kwargs) -> Any: ... -def implementedBy(*args, **kwargs) -> Any: ... -def providedBy(*args, **kwargs) -> Any: ... +adapter_hooks: list class ClassProvidesBase(_interface_coptimizations.SpecificationBase): + _cls: Any + _implements: Any @classmethod def __init__(cls, *args, **kwargs) -> None: ... - def __get__(self, *args, **kwargs) -> Any: ... + def __get__(self, instance, owner) -> Any: ... -class InterfaceBase: - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... +class InterfaceBase(_interface_coptimizations.SpecificationBase): + __ibmodule__: Any + __name__: Any + def __init__(self, *args, **kwargs) -> None: ... def __adapt__(self, *args, **kwargs) -> Any: ... def __call__(self, *args, **kwargs) -> Any: ... + def __eq__(self, other) -> bool: ... + def __ge__(self, other) -> bool: ... + def __gt__(self, other) -> bool: ... + def __hash__(self) -> int: ... + def __le__(self, other) -> bool: ... + def __lt__(self, other) -> bool: ... + def __ne__(self, other) -> bool: ... class LookupBase: @classmethod @@ -37,9 +39,15 @@ class LookupBase: class ObjectSpecificationDescriptor: @classmethod def __init__(cls, *args, **kwargs) -> None: ... - def __get__(self, *args, **kwargs) -> Any: ... + def __get__(self, instance, owner) -> Any: ... class SpecificationBase: + _bases: Any + _dependents: Any + _implied: Any + _v_attrs: Any + __iro__: Any + __sro__: Any @classmethod def __init__(cls, *args, **kwargs) -> None: ... def implementedBy(self, *args, **kwargs) -> Any: ... @@ -57,3 +65,7 @@ class VerifyingBase(_zope_interface_coptimizations.LookupBase): def lookupAll(self, *args, **kwargs) -> Any: ... def queryAdapter(self, *args, **kwargs) -> Any: ... def subscriptions(self, *args, **kwargs) -> Any: ... + +def getObjectSpecification(*args, **kwargs) -> Any: ... +def implementedBy(*args, **kwargs) -> Any: ... +def providedBy(*args, **kwargs) -> Any: ... diff --git a/src/zope-stubs/interface/adapter.pyi b/src/zope-stubs/interface/adapter.pyi index 843d3ef..d0dea51 100644 --- a/src/zope-stubs/interface/adapter.pyi +++ b/src/zope-stubs/interface/adapter.pyi @@ -1,58 +1,54 @@ -# Stubs for zope.interface.adapter (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from zope.interface._zope_interface_coptimizations import LookupBase, VerifyingBase +from _typeshed import Incomplete +from collections.abc import Generator class BaseAdapterRegistry: - __bases__: Any = ... - def __init__(self, bases: Any = ...) -> None: ... - def changed(self, originally_changed: Any) -> None: ... - def register(self, required: Any, provided: Any, name: Any, value: Any): ... - def registered(self, required: Any, provided: Any, name: Any = ...): ... - def unregister(self, required: Any, provided: Any, name: Any, value: Optional[Any] = ...): ... - def subscribe(self, required: Any, provided: Any, value: Any) -> None: ... - def unsubscribe(self, required: Any, provided: Any, value: Optional[Any] = ...): ... - def get(self, _: Any): ... - -class LookupBaseFallback: + __bases__: Incomplete + def __init__(self, bases=...) -> None: ... + def changed(self, originally_changed) -> None: ... + def register(self, required, provided, name, value) -> None: ... + def registered(self, required, provided, name: str = ...): ... + def allRegistrations(self) -> Generator[Incomplete, Incomplete, None]: ... + def unregister(self, required, provided, name, value: Incomplete | None = ...): ... + def subscribe(self, required, provided, value) -> None: ... + def subscribed(self, required, provided, subscriber): ... + def allSubscriptions(self) -> Generator[Incomplete, None, None]: ... + def unsubscribe(self, required, provided, value: Incomplete | None = ...) -> None: ... + def rebuild(self): ... + def get(self, _): ... + +class LookupBase: def __init__(self) -> None: ... - def changed(self, ignored: Optional[Any] = ...) -> None: ... - def lookup(self, required: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...): ... - def lookup1(self, required: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...): ... - def queryAdapter(self, object: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...): ... - def adapter_hook(self, provided: Any, object: Any, name: Any = ..., default: Optional[Any] = ...): ... - def lookupAll(self, required: Any, provided: Any): ... - def subscriptions(self, required: Any, provided: Any): ... -LookupBasePy = LookupBaseFallback -LookupBase = LookupBaseFallback - -class VerifyingBaseFallback(LookupBaseFallback): - def changed(self, originally_changed: Any) -> None: ... - def lookupAll(self, required: Any, provided: Any): ... - def subscriptions(self, required: Any, provided: Any): ... -VerifyingBasePy = VerifyingBaseFallback -VerifyingBase = VerifyingBaseFallback + def changed(self, ignored: Incomplete | None = ...) -> None: ... + def lookup(self, required, provided, name: str = ..., default: Incomplete | None = ...): ... + def lookup1(self, required, provided, name: str = ..., default: Incomplete | None = ...): ... + def queryAdapter(self, object, provided, name: str = ..., default: Incomplete | None = ...): ... + def adapter_hook(self, provided, object, name: str = ..., default: Incomplete | None = ...): ... + def lookupAll(self, required, provided): ... + def subscriptions(self, required, provided): ... + +class VerifyingBase(LookupBaseFallback): + def changed(self, originally_changed) -> None: ... + def lookupAll(self, required, provided): ... + def subscriptions(self, required, provided): ... class AdapterLookupBase: - def __init__(self, registry: Any) -> None: ... - def changed(self, ignored: Optional[Any] = ...) -> None: ... + def __init__(self, registry) -> None: ... + def changed(self, ignored: Incomplete | None = ...) -> None: ... def init_extendors(self) -> None: ... - def add_extendor(self, provided: Any) -> None: ... - def remove_extendor(self, provided: Any) -> None: ... - def queryMultiAdapter(self, objects: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...): ... - def names(self, required: Any, provided: Any): ... - def subscribers(self, objects: Any, provided: Any): ... + def add_extendor(self, provided) -> None: ... + def remove_extendor(self, provided) -> None: ... + def queryMultiAdapter(self, objects, provided, name: str = ..., default: Incomplete | None = ...): ... + def names(self, required, provided): ... + def subscribers(self, objects, provided): ... class AdapterLookup(AdapterLookupBase, LookupBase): ... class AdapterRegistry(BaseAdapterRegistry): - LookupClass: Any = ... - def __init__(self, bases: Any = ...) -> None: ... - def changed(self, originally_changed: Any) -> None: ... + LookupClass = AdapterLookup + def __init__(self, bases=...) -> None: ... + def changed(self, originally_changed) -> None: ... class VerifyingAdapterLookup(AdapterLookupBase, VerifyingBase): ... class VerifyingAdapterRegistry(BaseAdapterRegistry): - LookupClass: Any = ... + LookupClass = VerifyingAdapterLookup diff --git a/src/zope-stubs/interface/advice.pyi b/src/zope-stubs/interface/advice.pyi index e9612bf..d5a2cf1 100644 --- a/src/zope-stubs/interface/advice.pyi +++ b/src/zope-stubs/interface/advice.pyi @@ -1,11 +1,6 @@ -# Stubs for zope.interface.advice (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from _typeshed import Incomplete -from typing import Any, Optional - -def getFrameInfo(frame: Any): ... -def addClassAdvisor(callback: Any, depth: int = ...): ... -def isClassAdvisor(ob: Any): ... -def determineMetaclass(bases: Any, explicit_mc: Optional[Any] = ...): ... -def minimalBases(classes: Any): ... +def getFrameInfo(frame): ... +def isClassAdvisor(ob): ... +def determineMetaclass(bases, explicit_mc: Incomplete | None = ...): ... +def minimalBases(classes): ... diff --git a/src/zope-stubs/interface/common/__init__.pyi b/src/zope-stubs/interface/common/__init__.pyi index cf59908..c978d76 100644 --- a/src/zope-stubs/interface/common/__init__.pyi +++ b/src/zope-stubs/interface/common/__init__.pyi @@ -1,4 +1,16 @@ -# Stubs for zope.interface.common (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from _typeshed import Incomplete +from zope.interface import Interface as Interface, classImplements as classImplements +from zope.interface.interface import InterfaceClass as InterfaceClass, fromFunction as fromFunction +class optional: + __doc__: Incomplete + def __init__(self, method) -> None: ... + +class ABCInterfaceClass(InterfaceClass): + __name__: Incomplete + __class__: Incomplete + def __init__(self, name, bases, attrs) -> None: ... + def getABC(self): ... + def getRegisteredConformers(self): ... + +class ABCInterface(metaclass=ABCInterfaceClass): ... diff --git a/src/zope-stubs/interface/common/builtins.pyi b/src/zope-stubs/interface/common/builtins.pyi new file mode 100644 index 0000000..8c6a00a --- /dev/null +++ b/src/zope-stubs/interface/common/builtins.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete +from zope.interface.common import collections, io, numbers + +class IList(collections.IMutableSequence): + extra_classes: Incomplete + def sort(key: Incomplete | None = ..., reverse: bool = ...) -> None: ... + +class ITuple(collections.ISequence): + extra_classes: Incomplete + +class ITextString(collections.ISequence): + extra_classes: Incomplete + +class IByteString(collections.IByteString): + extra_classes: Incomplete + +class INativeString(ITextString): ... + +class IBool(numbers.IIntegral): + extra_classes: Incomplete + +class IDict(collections.IMutableMapping): + extra_classes: Incomplete + +class IFile(io.IIOBase): + extra_classes: Incomplete diff --git a/src/zope-stubs/interface/common/collections.pyi b/src/zope-stubs/interface/common/collections.pyi new file mode 100644 index 0000000..b99472b --- /dev/null +++ b/src/zope-stubs/interface/common/collections.pyi @@ -0,0 +1,88 @@ +from _typeshed import Incomplete +from collections import abc +from zope.interface.common import ABCInterface + +class IContainer(ABCInterface): + abc = abc.Container + def __contains__(other) -> bool: ... + +class IHashable(ABCInterface): + abc = abc.Hashable + +class IIterable(ABCInterface): + abc = abc.Iterable + def __iter__(): ... + +class IIterator(IIterable): + abc = abc.Iterator + +class IReversible(IIterable): + abc: Incomplete + def __reversed__() -> None: ... + +class IGenerator(IIterator): + abc: Incomplete + +class ISized(ABCInterface): + abc = abc.Sized + +class ICollection(ISized, IIterable, IContainer): + abc: Incomplete + +class ISequence(IReversible, ICollection): + abc = abc.Sequence + extra_classes: Incomplete + ignored_classes: Incomplete + def __reversed__() -> None: ... + def __iter__(): ... + +class IMutableSequence(ISequence): + abc = abc.MutableSequence + extra_classes: Incomplete + +class IByteString(ISequence): + abc: Incomplete + +class ISet(ICollection): + abc = abc.Set + +class IMutableSet(ISet): + abc = abc.MutableSet + +class IMapping(ICollection): + abc = abc.Mapping + extra_classes: Incomplete + ignored_classes: Incomplete + +class IMutableMapping(IMapping): + abc = abc.MutableMapping + extra_classes: Incomplete + ignored_classes: Incomplete + +class IMappingView(ISized): + abc = abc.MappingView + +class IItemsView(IMappingView, ISet): + abc = abc.ItemsView + +class IKeysView(IMappingView, ISet): + abc = abc.KeysView + +class IValuesView(IMappingView, ICollection): + abc = abc.ValuesView + def __contains__(other) -> bool: ... + +class IAwaitable(ABCInterface): + abc: Incomplete + +class ICoroutine(IAwaitable): + abc: Incomplete + +class IAsyncIterable(ABCInterface): + abc: Incomplete + +class IAsyncIterator(IAsyncIterable): + abc: Incomplete + +class IAsyncGenerator(IAsyncIterator): + abc: Incomplete diff --git a/src/zope-stubs/interface/common/idatetime.pyi b/src/zope-stubs/interface/common/idatetime.pyi index 3a0a1db..664c5d1 100644 --- a/src/zope-stubs/interface/common/idatetime.pyi +++ b/src/zope-stubs/interface/common/idatetime.pyi @@ -1,33 +1,29 @@ -# Stubs for zope.interface.common.idatetime (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from zope.interface import Interface +from _typeshed import Incomplete +from zope.interface import Attribute as Attribute, Interface as Interface, classImplements as classImplements class ITimeDeltaClass(Interface): - min: Any = ... - max: Any = ... - resolution: Any = ... + min: Incomplete + max: Incomplete + resolution: Incomplete class ITimeDelta(ITimeDeltaClass): - days: Any = ... - seconds: Any = ... - microseconds: Any = ... + days: Incomplete + seconds: Incomplete + microseconds: Incomplete class IDateClass(Interface): - min: Any = ... - max: Any = ... - resolution: Any = ... + min: Incomplete + max: Incomplete + resolution: Incomplete def today() -> None: ... - def fromtimestamp(timestamp: Any) -> None: ... - def fromordinal(ordinal: Any) -> None: ... + def fromtimestamp(timestamp) -> None: ... + def fromordinal(ordinal) -> None: ... class IDate(IDateClass): - year: Any = ... - month: Any = ... - day: Any = ... - def replace(year: Any, month: Any, day: Any) -> None: ... + year: Incomplete + month: Incomplete + day: Incomplete + def replace(year, month, day) -> None: ... def timetuple() -> None: ... def toordinal() -> None: ... def weekday() -> None: ... @@ -35,34 +31,34 @@ class IDate(IDateClass): def isocalendar() -> None: ... def isoformat() -> None: ... def ctime() -> None: ... - def strftime(format: Any) -> None: ... + def strftime(format) -> None: ... class IDateTimeClass(Interface): - min: Any = ... - max: Any = ... - resolution: Any = ... + min: Incomplete + max: Incomplete + resolution: Incomplete def today() -> None: ... - def now(tz: Optional[Any] = ...) -> None: ... + def now(tz: Incomplete | None = ...) -> None: ... def utcnow() -> None: ... - def fromtimestamp(timestamp: Any, tz: Optional[Any] = ...) -> None: ... - def utcfromtimestamp(timestamp: Any) -> None: ... - def fromordinal(ordinal: Any) -> None: ... - def combine(date: Any, time: Any) -> None: ... + def fromtimestamp(timestamp, tz: Incomplete | None = ...) -> None: ... + def utcfromtimestamp(timestamp) -> None: ... + def fromordinal(ordinal) -> None: ... + def combine(date, time) -> None: ... class IDateTime(IDate, IDateTimeClass): - year: Any = ... - month: Any = ... - day: Any = ... - hour: Any = ... - minute: Any = ... - second: Any = ... - microsecond: Any = ... - tzinfo: Any = ... + year: Incomplete + month: Incomplete + day: Incomplete + hour: Incomplete + minute: Incomplete + second: Incomplete + microsecond: Incomplete + tzinfo: Incomplete def date() -> None: ... def time() -> None: ... def timetz() -> None: ... - def replace(year: Any, month: Any, day: Any, hour: Any, minute: Any, second: Any, microsecond: Any, tzinfo: Any) -> None: ... - def astimezone(tz: Any) -> None: ... + def replace(year, month, day, hour, minute, second, microsecond, tzinfo) -> None: ... + def astimezone(tz) -> None: ... def utcoffset() -> None: ... def dst() -> None: ... def tzname() -> None: ... @@ -74,28 +70,28 @@ class IDateTime(IDate, IDateTimeClass): def isocalendar() -> None: ... def isoformat(sep: str = ...) -> None: ... def ctime() -> None: ... - def strftime(format: Any) -> None: ... + def strftime(format) -> None: ... class ITimeClass(Interface): - min: Any = ... - max: Any = ... - resolution: Any = ... + min: Incomplete + max: Incomplete + resolution: Incomplete class ITime(ITimeClass): - hour: Any = ... - minute: Any = ... - second: Any = ... - microsecond: Any = ... - tzinfo: Any = ... - def replace(hour: Any, minute: Any, second: Any, microsecond: Any, tzinfo: Any) -> None: ... + hour: Incomplete + minute: Incomplete + second: Incomplete + microsecond: Incomplete + tzinfo: Incomplete + def replace(hour, minute, second, microsecond, tzinfo) -> None: ... def isoformat() -> None: ... - def strftime(format: Any) -> None: ... + def strftime(format) -> None: ... def utcoffset() -> None: ... def dst() -> None: ... def tzname() -> None: ... class ITZInfo(Interface): - def utcoffset(dt: Any) -> None: ... - def dst(dt: Any) -> None: ... - def tzname(dt: Any) -> None: ... - def fromutc(dt: Any) -> None: ... + def utcoffset(dt) -> None: ... + def dst(dt) -> None: ... + def tzname(dt) -> None: ... + def fromutc(dt) -> None: ... diff --git a/src/zope-stubs/interface/common/interfaces.pyi b/src/zope-stubs/interface/common/interfaces.pyi index 8a16884..48991d7 100644 --- a/src/zope-stubs/interface/common/interfaces.pyi +++ b/src/zope-stubs/interface/common/interfaces.pyi @@ -1,8 +1,4 @@ -# Stubs for zope.interface.common.interfaces (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from zope.interface import Interface +from zope.interface import Interface as Interface, classImplements as classImplements class IException(Interface): ... class IStandardError(IException): ... diff --git a/src/zope-stubs/interface/common/io.pyi b/src/zope-stubs/interface/common/io.pyi new file mode 100644 index 0000000..a201175 --- /dev/null +++ b/src/zope-stubs/interface/common/io.pyi @@ -0,0 +1,16 @@ +import io as abc +from _typeshed import Incomplete +from zope.interface.common import ABCInterface as ABCInterface + +class IIOBase(ABCInterface): + abc = abc.IOBase + +class IRawIOBase(IIOBase): + abc = abc.RawIOBase + +class IBufferedIOBase(IIOBase): + abc = abc.BufferedIOBase + extra_classes: Incomplete + +class ITextIOBase(IIOBase): + abc = abc.TextIOBase diff --git a/src/zope-stubs/interface/common/numbers.pyi b/src/zope-stubs/interface/common/numbers.pyi new file mode 100644 index 0000000..f4f6932 --- /dev/null +++ b/src/zope-stubs/interface/common/numbers.pyi @@ -0,0 +1,21 @@ +import numbers as abc +from zope.interface.common import ABCInterface as ABCInterface, optional as optional + +class INumber(ABCInterface): + abc = abc.Number + +class IComplex(INumber): + abc = abc.Complex + def __complex__() -> complex: ... + +class IReal(IComplex): + abc = abc.Real + def __complex__() -> complex: ... + __floor__ = __complex__ + __ceil__ = __complex__ + +class IRational(IReal): + abc = abc.Rational + +class IIntegral(IRational): + abc = abc.Integral diff --git a/src/zope-stubs/interface/common/sequence.pyi b/src/zope-stubs/interface/common/sequence.pyi index 04f7968..88f9b99 100644 --- a/src/zope-stubs/interface/common/sequence.pyi +++ b/src/zope-stubs/interface/common/sequence.pyi @@ -1,50 +1,43 @@ -# Stubs for zope.interface.common.sequence (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from zope.interface import Interface +from _typeshed import Incomplete +from zope.interface import Interface as Interface +from zope.interface.common import collections as collections __docformat__: str -class IMinimalSequence(Interface): - def __getitem__(index: Any) -> None: ... - -class IFiniteSequence(IMinimalSequence): - def __len__() -> None: ... - -class IReadSequence(IFiniteSequence): - def __contains__(item: Any) -> None: ... - def __lt__(other: Any) -> None: ... - def __le__(other: Any) -> None: ... - def __eq__(other: Any) -> None: ... - def __ne__(other: Any) -> None: ... - def __gt__(other: Any) -> None: ... - def __ge__(other: Any) -> None: ... - def __add__(other: Any) -> None: ... - def __mul__(n: Any) -> None: ... - def __rmul__(n: Any) -> None: ... - def __getslice__(i: Any, j: Any) -> None: ... +class IMinimalSequence(collections.IIterable): + def __getitem__(index) -> None: ... + +class IFiniteSequence(collections.ISized, IMinimalSequence): ... + +class IReadSequence(collections.IContainer, IFiniteSequence): + def __contains__(item) -> bool: ... + def __lt__(other): ... + def __le__(other): ... + def __eq__(other): ... + def __ne__(other): ... + def __gt__(other): ... + def __ge__(other): ... + def __add__(other) -> None: ... + def __mul__(n) -> None: ... + def __rmul__(n) -> None: ... class IExtendedReadSequence(IReadSequence): - def count(item: Any) -> None: ... - def index(item: Any, *args: Any) -> None: ... + def count(item) -> None: ... + def index(item, *args) -> None: ... class IUniqueMemberWriteSequence(Interface): - def __setitem__(index: Any, item: Any) -> None: ... - def __delitem__(index: Any) -> None: ... - def __setslice__(i: Any, j: Any, other: Any) -> None: ... - def __delslice__(i: Any, j: Any) -> None: ... - def __iadd__(y: Any) -> None: ... - def append(item: Any) -> None: ... - def insert(index: Any, item: Any) -> None: ... + def __setitem__(index, item) -> None: ... + def __delitem__(index) -> None: ... + def __iadd__(y) -> None: ... + def append(item) -> None: ... + def insert(index, item) -> None: ... def pop(index: int = ...) -> None: ... - def remove(item: Any) -> None: ... + def remove(item) -> None: ... def reverse() -> None: ... - def sort(cmpfunc: Optional[Any] = ...) -> None: ... - def extend(iterable: Any) -> None: ... + def sort(cmpfunc: Incomplete | None = ...) -> None: ... + def extend(iterable) -> None: ... class IWriteSequence(IUniqueMemberWriteSequence): - def __imul__(n: Any) -> None: ... + def __imul__(n) -> None: ... class ISequence(IReadSequence, IWriteSequence): ... diff --git a/src/zope-stubs/interface/declarations.pyi b/src/zope-stubs/interface/declarations.pyi index b7dc34f..668f8c7 100644 --- a/src/zope-stubs/interface/declarations.pyi +++ b/src/zope-stubs/interface/declarations.pyi @@ -1,100 +1,95 @@ -# Stubs for zope.interface.declarations (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from zope.interface._zope_interface_coptimizations import ClassProvidesBase -from zope.interface.interface import Specification +from _typeshed import Incomplete +from zope.interface.interface import Interface as Interface, InterfaceClass as InterfaceClass, NameAndModuleComparisonMixin as NameAndModuleComparisonMixin, Specification as Specification, SpecificationBase as SpecificationBase __docformat__: str -BuiltinImplementationSpecifications: Any +BuiltinImplementationSpecifications: Incomplete class named: - name: Any = ... - def __init__(self, name: Any) -> None: ... - def __call__(self, ob: Any): ... + name: Incomplete + def __init__(self, name) -> None: ... + def __call__(self, ob): ... class Declaration(Specification): - def __init__(self, *interfaces: Any) -> None: ... - def changed(self, originally_changed: Any) -> None: ... - def __contains__(self, interface: Any): ... + def __init__(self, *bases) -> None: ... + def __contains__(self, interface) -> bool: ... def __iter__(self): ... def flattened(self): ... - def __sub__(self, other: Any): ... - def __add__(self, other: Any): ... - __radd__: Any = ... - -class Implements(Declaration): - inherit: Any = ... - declared: Any = ... - __name__: str = ... + def __sub__(self, other): ... + def __add__(self, other): ... + __radd__ = __add__ + +class _ImmutableDeclaration(Declaration): + def __new__(cls): ... + def __reduce__(self): ... + @property + def __bases__(self): ... + @property + def dependents(self): ... + changed: Incomplete + subscribe: Incomplete + unsubscribe: Incomplete + def interfaces(self): ... + def extends(self, interface, strict: bool = ...): ... + def get(self, name, default: Incomplete | None = ...): ... + def weakref(self, callback: Incomplete | None = ...): ... + +class Implements(NameAndModuleComparisonMixin, Declaration): + inherit: Incomplete + declared: Incomplete + __name__: str @classmethod - def named(cls, name: Any, *interfaces: Any): ... + def named(cls, name, *bases): ... + def changed(self, originally_changed): ... def __reduce__(self): ... - def __hash__(self): ... - def __lt__(self, other: Any): ... - def __le__(self, other: Any): ... - def __gt__(self, other: Any): ... - def __ge__(self, other: Any): ... - -def implementedByFallback(cls): ... -implementedBy = implementedByFallback -def classImplementsOnly(cls, *interfaces: Any) -> None: ... -def classImplements(cls, *interfaces: Any) -> None: ... +def implementedBy(cls): ... +def classImplementsOnly(cls, *interfaces) -> None: ... +def classImplements(cls, *interfaces) -> None: ... +def classImplementsFirst(cls, iface) -> None: ... class implementer: - interfaces: Any = ... - def __init__(self, *interfaces: Any) -> None: ... - def __call__(self, ob: Any): ... + interfaces: Incomplete + def __init__(self, *interfaces) -> None: ... + def __call__(self, ob): ... class implementer_only: - interfaces: Any = ... - def __init__(self, *interfaces: Any) -> None: ... - def __call__(self, ob: Any): ... - -def implements(*interfaces: Any) -> None: ... -def implementsOnly(*interfaces: Any) -> None: ... + interfaces: Incomplete + def __init__(self, *interfaces) -> None: ... + def __call__(self, ob): ... class Provides(Declaration): - def __init__(self, cls: Any, *interfaces: Any) -> None: ... + def __init__(self, cls, *interfaces) -> None: ... def __reduce__(self): ... - __module__: str = ... - def __get__(self, inst: Any, cls: Any): ... + __module__: str + def __get__(self, inst, cls): ... ProvidesClass = Provides -InstanceDeclarations: Any +InstanceDeclarations: Incomplete -def directlyProvides(object: Any, *interfaces: Any) -> None: ... -def alsoProvides(object: Any, *interfaces: Any) -> None: ... -def noLongerProvides(object: Any, interface: Any) -> None: ... +def directlyProvides(object, *interfaces) -> None: ... +def alsoProvides(object, *interfaces) -> None: ... +def noLongerProvides(object, interface) -> None: ... -class ClassProvidesBaseFallback: - def __get__(self, inst: Any, cls: Any): ... -ClassProvidesBasePy = ClassProvidesBaseFallback -ClassProvidesBase = ClassProvidesBaseFallback +class ClassProvidesBase(SpecificationBase): + def __get__(self, inst, cls): ... class ClassProvides(Declaration, ClassProvidesBase): - def __init__(self, cls: Any, metacls: Any, *interfaces: Any) -> None: ... + def __init__(self, cls, metacls, *interfaces) -> None: ... def __reduce__(self): ... - __get__: Any = ... + __get__: Incomplete -def directlyProvidedBy(object: Any): ... -def classProvides(*interfaces: Any) -> None: ... +def directlyProvidedBy(object): ... class provider: - interfaces: Any = ... - def __init__(self, *interfaces: Any) -> None: ... - def __call__(self, ob: Any): ... - -def moduleProvides(*interfaces: Any) -> None: ... -def ObjectSpecification(direct: Any, cls: Any): ... -def getObjectSpecificationFallback(ob: Any): ... -getObjectSpecification = getObjectSpecificationFallback - -def providedByFallback(ob: Any): ... -providedBy = providedByFallback - -class ObjectSpecificationDescriptorFallback: - def __get__(self, inst: Any, cls: Any): ... -ObjectSpecificationDescriptor = ObjectSpecificationDescriptorFallback -objectSpecificationDescriptor: Any + interfaces: Incomplete + def __init__(self, *interfaces) -> None: ... + def __call__(self, ob): ... + +def moduleProvides(*interfaces) -> None: ... +def ObjectSpecification(direct, cls): ... +def getObjectSpecification(ob): ... +def providedBy(ob): ... + +class ObjectSpecificationDescriptor: + def __get__(self, inst, cls): ... + +objectSpecificationDescriptor: Incomplete diff --git a/src/zope-stubs/interface/document.pyi b/src/zope-stubs/interface/document.pyi index 94e946f..a458bef 100644 --- a/src/zope-stubs/interface/document.pyi +++ b/src/zope-stubs/interface/document.pyi @@ -1,8 +1,2 @@ -# Stubs for zope.interface.document (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -def asStructuredText(I: Any, munge: int = ..., rst: bool = ...): ... -def asReStructuredText(I: Any, munge: int = ...): ... +def asStructuredText(I, munge: int = ..., rst: bool = ...): ... +def asReStructuredText(I, munge: int = ...): ... diff --git a/src/zope-stubs/interface/exceptions.pyi b/src/zope-stubs/interface/exceptions.pyi index 2c48fe9..940bb15 100644 --- a/src/zope-stubs/interface/exceptions.pyi +++ b/src/zope-stubs/interface/exceptions.pyi @@ -1,24 +1,27 @@ -# Stubs for zope.interface.exceptions (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +class Invalid(Exception): ... -from typing import Any +class _TargetInvalid(Invalid): + @property + def interface(self): ... + @property + def target(self): ... -class Invalid(Exception): ... +class DoesNotImplement(_TargetInvalid): ... -class DoesNotImplement(Invalid): - interface: Any = ... - def __init__(self, interface: Any) -> None: ... +class BrokenImplementation(_TargetInvalid): + @property + def name(self): ... -class BrokenImplementation(Invalid): - interface: Any = ... - name: Any = ... - def __init__(self, interface: Any, name: Any) -> None: ... +class BrokenMethodImplementation(_TargetInvalid): + @property + def method(self): ... + @property + def mess(self): ... -class BrokenMethodImplementation(Invalid): - method: Any = ... - mess: Any = ... - def __init__(self, method: Any, mess: Any) -> None: ... +class MultipleInvalid(_TargetInvalid): + def __init__(self, interface, target, exceptions) -> None: ... + @property + def exceptions(self): ... class InvalidInterface(Exception): ... class BadImplements(TypeError): ... diff --git a/src/zope-stubs/interface/interface.pyi b/src/zope-stubs/interface/interface.pyi index 2ec07ec..23464e7 100644 --- a/src/zope-stubs/interface/interface.pyi +++ b/src/zope-stubs/interface/interface.pyi @@ -1,93 +1,103 @@ -# Stubs for zope.interface.interface (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -CO_VARARGS: int -CO_VARKEYWORDS: int -TAGGED_DATA: str - -def invariant(call: Any): ... -def taggedValue(key: Any, value: Any): ... +from _typeshed import Incomplete +from collections.abc import Generator class Element: - __name__: Any = ... - __doc__: Any = ... - def __init__(self, __name__: Any, __doc__: str = ...) -> None: ... + __name__: Incomplete + __doc__: Incomplete + def __init__(self, __name__, __doc__: str = ...) -> None: ... def getName(self): ... def getDoc(self): ... - def getTaggedValue(self, tag: Any): ... - def queryTaggedValue(self, tag: Any, default: Optional[Any] = ...): ... + def getTaggedValue(self, tag): ... + def queryTaggedValue(self, tag, default: Incomplete | None = ...): ... def getTaggedValueTags(self): ... - def setTaggedValue(self, tag: Any, value: Any) -> None: ... + def setTaggedValue(self, tag, value) -> None: ... + queryDirectTaggedValue = queryTaggedValue + getDirectTaggedValue = getTaggedValue + getDirectTaggedValueTags = getTaggedValueTags +SpecificationBasePy = object -class SpecificationBasePy: - def providedBy(self, ob: Any) -> bool: ... - def implementedBy(self, cls: Any) -> bool: ... - def isOrExtends(self, interface: Any) -> bool: ... - __call__: Any = ... -SpecificationBase = SpecificationBasePy +class SpecificationBase: + def providedBy(self, ob) -> bool: ... + def implementedBy(self, cls) -> bool: ... + def isOrExtends(self, interface) -> bool: ... + __call__ = isOrExtends -class InterfaceBasePy: - def __call__(self, obj: Any, alternate: Any = ...): ... - def __adapt__(self, obj: Any): ... -InterfaceBase = InterfaceBasePy -adapter_hooks: Any +class NameAndModuleComparisonMixin: + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + +class InterfaceBase(NameAndModuleComparisonMixin, SpecificationBase): + __name__: Incomplete + __ibmodule__: Incomplete + def __init__(self, name: Incomplete | None = ..., module: Incomplete | None = ...) -> None: ... + @property + def __module_property__(self): ... + def __call__(self, obj, alternate=...): ... + def __adapt__(self, obj): ... + def __hash__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +adapter_hooks: Incomplete class Specification(SpecificationBase): - dependents: Any = ... - __bases__: Any = ... - def __init__(self, bases: Any = ...) -> None: ... - def subscribe(self, dependent: Any) -> None: ... - def unsubscribe(self, dependent: Any) -> None: ... - __sro__: Any = ... - __iro__: Any = ... - def changed(self, originally_changed: Any) -> None: ... - def interfaces(self) -> None: ... - def extends(self, interface: Any, strict: bool = ...): ... - def weakref(self, callback: Optional[Any] = ...): ... - def get(self, name: Any, default: Optional[Any] = ...): ... + __iro__: Incomplete + __sro__: Incomplete + __bases__: Incomplete + def __init__(self, bases=...) -> None: ... + @property + def dependents(self): ... + def subscribe(self, dependent) -> None: ... + def unsubscribe(self, dependent) -> None: ... + def changed(self, originally_changed) -> None: ... + def interfaces(self) -> Generator[Incomplete, None, None]: ... + def extends(self, interface, strict: bool = ...): ... + def weakref(self, callback: Incomplete | None = ...): ... + def get(self, name, default: Incomplete | None = ...): ... + +class _InterfaceMetaClass(type): + def __new__(cls, name, bases, attrs): ... + @property + def __module__(cls): ... + class InterfaceClass(type, Element, InterfaceBase, Specification): - __module__: Any = ... - __identifier__: Any = ... - def __init__(self, name: Any, bases: Any = ..., attrs: Optional[Any] = ..., __doc__: Optional[Any] = ..., __module__: Optional[Any] = ...) -> None: ... - def interfaces(self) -> None: ... + def __new__(cls, name: Incomplete | None = ..., bases=..., attrs: Incomplete | None = ..., __doc__: Incomplete | None = ..., __module__: Incomplete | None = ...): ... + __identifier__: Incomplete + def __init__(self, name, bases=..., attrs: Incomplete | None = ..., __doc__: Incomplete | None = ..., __module__: Incomplete | None = ...) -> None: ... + def interfaces(self) -> Generator[Incomplete, None, None]: ... def getBases(self): ... - def isEqualOrExtendedBy(self, other: Any): ... + def isEqualOrExtendedBy(self, other): ... def names(self, all: bool = ...): ... def __iter__(self): ... def namesAndDescriptions(self, all: bool = ...): ... - def getDescriptionFor(self, name: Any): ... - def __getitem__(self, key, default: Optional[Any] = ...) -> Any: ... - def __contains__(self, name: Any): ... - def direct(self, name: Any): ... - def queryDescriptionFor(self, name: Any, default: Optional[Any] = ...): ... - def validateInvariants(self, obj: Any, errors: Optional[Any] = ...) -> None: ... + def getDescriptionFor(self, name): ... + __getitem__ = getDescriptionFor + def __contains__(self, name) -> bool: ... + def direct(self, name): ... + def queryDescriptionFor(self, name, default: Incomplete | None = ...): ... + def validateInvariants(self, obj, errors: Incomplete | None = ...) -> None: ... + def queryTaggedValue(self, tag, default: Incomplete | None = ...): ... + def getTaggedValue(self, tag): ... + def getTaggedValueTags(self): ... def __reduce__(self): ... - def __hash__(self): ... - def __eq__(self, other: Any): ... - def __ne__(self, other: Any): ... - def __lt__(self, other: Any): ... - def __le__(self, other: Any): ... - def __gt__(self, other: Any): ... - def __ge__(self, other: Any): ... -class Interface(metaclass=InterfaceClass): ... +class _InterfaceClassWithCustomMethods(InterfaceClass): ... class Attribute(Element): - interface: Any = ... + interface: Incomplete class Method(Attribute): - positional: Any = ... - required: Any = ... - varargs: Any = ... - kwargs: Any = ... - optional: Any = ... - def __call__(self, *args: Any, **kw: Any) -> None: ... + positional: Incomplete + required: Incomplete + varargs: Incomplete + kwargs: Incomplete + optional: Incomplete + def __call__(self, *args, **kw) -> None: ... def getSignatureInfo(self): ... def getSignatureString(self): ... -def fromFunction(func: Any, interface: Optional[Any] = ..., imlevel: int = ..., name: Optional[Any] = ...): ... -def fromMethod(meth: Any, interface: Optional[Any] = ..., name: Optional[Any] = ...): ... + +class Interface(metaclass=InterfaceClass): ... diff --git a/src/zope-stubs/interface/interfaces.pyi b/src/zope-stubs/interface/interfaces.pyi index cb05274..85539b5 100644 --- a/src/zope-stubs/interface/interfaces.pyi +++ b/src/zope-stubs/interface/interfaces.pyi @@ -1,22 +1,19 @@ -# Stubs for zope.interface.interfaces (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional +from _typeshed import Incomplete from zope.interface.interface import Interface -__docformat__: str - class IElement(Interface): - __name__: Any = ... - __doc__: Any = ... - def getTaggedValue(tag: Any) -> None: ... - def queryTaggedValue(tag: Any, default: Optional[Any] = ...) -> None: ... + __name__: Incomplete + __doc__: Incomplete + def getTaggedValue(tag) -> None: ... + def queryTaggedValue(tag, default: Incomplete | None = ...) -> None: ... def getTaggedValueTags() -> None: ... - def setTaggedValue(tag: Any, value: Any) -> None: ... + def setTaggedValue(tag, value) -> None: ... + def getDirectTaggedValue(tag) -> None: ... + def queryDirectTaggedValue(tag, default: Incomplete | None = ...) -> None: ... + def getDirectTaggedValueTags() -> None: ... class IAttribute(IElement): - interface: Any = ... + interface: Incomplete class IMethod(IAttribute): def getSignatureInfo() -> None: ... @@ -24,112 +21,118 @@ class IMethod(IAttribute): class ISpecification(Interface): @staticmethod - def providedBy(object: Any) -> bool: ... + def providedBy(object) -> bool: ... @staticmethod - def implementedBy(class_: Any) -> bool: ... + def implementedBy(class_) -> bool: ... @staticmethod - def isOrExtends(other: Any) -> bool: ... + def isOrExtends(other) -> bool: ... @staticmethod - def extends(other: Any, strict: bool = ...) -> None: ... + def extends(other, strict: bool = ...) -> None: ... @staticmethod - def weakref(callback: Optional[Any] = ...) -> None: ... - def get(name: Any, default: Optional[Any] = ...) -> None: ... + def weakref(callback: Incomplete | None = ...) -> None: ... + __bases__: Incomplete + __sro__: Incomplete + __iro__: Incomplete + def get(name, default: Incomplete | None = ...) -> None: ... class IInterface(ISpecification, IElement): def names(all: bool = ...) -> None: ... def namesAndDescriptions(all: bool = ...) -> None: ... - def __getitem__(name: Any) -> None: ... - def direct(name: Any) -> None: ... - def validateInvariants(obj: Any, errors: Optional[Any] = ...) -> None: ... - def __contains__(name: Any) -> None: ... - def __iter__() -> None: ... - __module__: Any = ... + def __getitem__(name) -> None: ... + def direct(name) -> None: ... + def validateInvariants(obj, errors: Incomplete | None = ...) -> None: ... + def __contains__(name) -> bool: ... + def __iter__(): ... + __module__: Incomplete class IDeclaration(ISpecification): - def __contains__(interface: Any) -> None: ... - def __iter__() -> None: ... + def __contains__(interface) -> bool: ... + def __iter__(): ... def flattened() -> None: ... - def __sub__(interfaces: Any) -> None: ... - def __add__(interfaces: Any) -> None: ... + def __sub__(interfaces) -> None: ... + def __add__(interfaces) -> None: ... def __nonzero__() -> None: ... class IInterfaceDeclaration(Interface): - def providedBy(ob: Any) -> None: ... - def implementedBy(class_: Any) -> None: ... - def classImplements(class_: Any, *interfaces: Any) -> None: ... - def implementer(*interfaces: Any) -> None: ... - def classImplementsOnly(class_: Any, *interfaces: Any) -> None: ... - def implementer_only(*interfaces: Any) -> None: ... - def directlyProvidedBy(object: Any) -> None: ... - def directlyProvides(object: Any, *interfaces: Any) -> None: ... - def alsoProvides(object: Any, *interfaces: Any) -> None: ... - def noLongerProvides(object: Any, interface: Any) -> None: ... - def implements(*interfaces: Any) -> None: ... - def implementsOnly(*interfaces: Any) -> None: ... - def classProvides(*interfaces: Any) -> None: ... - def provider(*interfaces: Any) -> None: ... - def moduleProvides(*interfaces: Any) -> None: ... - def Declaration(*interfaces: Any) -> None: ... + Interface: Incomplete + def taggedValue(key, value) -> None: ... + def invariant(checker_function) -> None: ... + def interfacemethod(method) -> None: ... + def providedBy(ob) -> None: ... + def implementedBy(class_) -> None: ... + def classImplements(class_, *interfaces) -> None: ... + def classImplementsFirst(cls, interface) -> None: ... + def implementer(*interfaces) -> None: ... + def classImplementsOnly(class_, *interfaces) -> None: ... + def implementer_only(*interfaces) -> None: ... + def directlyProvidedBy(object) -> None: ... + def directlyProvides(object, *interfaces) -> None: ... + def alsoProvides(object, *interfaces) -> None: ... + def noLongerProvides(object, interface) -> None: ... + def provider(*interfaces) -> None: ... + def moduleProvides(*interfaces) -> None: ... + def Declaration(*interfaces) -> None: ... class IAdapterRegistry(Interface): - def register(required: Any, provided: Any, name: Any, value: Any) -> None: ... - def registered(required: Any, provided: Any, name: Any = ...) -> None: ... - def lookup(required: Any, provided: Any, name: str = ..., default: Optional[Any] = ...) -> None: ... - def queryMultiAdapter(objects: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...) -> None: ... - def lookup1(required: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...) -> None: ... - def queryAdapter(object: Any, provided: Any, name: Any = ..., default: Optional[Any] = ...) -> None: ... - def adapter_hook(provided: Any, object: Any, name: Any = ..., default: Optional[Any] = ...) -> None: ... - def lookupAll(required: Any, provided: Any) -> None: ... - def names(required: Any, provided: Any) -> None: ... - def subscribe(required: Any, provided: Any, subscriber: Any, name: Any = ...) -> None: ... - def subscriptions(required: Any, provided: Any, name: Any = ...) -> None: ... - def subscribers(objects: Any, provided: Any, name: Any = ...) -> None: ... + def register(required, provided, name, value) -> None: ... + def registered(required, provided, name: str = ...) -> None: ... + def lookup(required, provided, name: str = ..., default: Incomplete | None = ...) -> None: ... + def queryMultiAdapter(objects, provided, name: str = ..., default: Incomplete | None = ...) -> None: ... + def lookup1(required, provided, name: str = ..., default: Incomplete | None = ...) -> None: ... + def queryAdapter(object, provided, name: str = ..., default: Incomplete | None = ...) -> None: ... + def adapter_hook(provided, object, name: str = ..., default: Incomplete | None = ...) -> None: ... + def lookupAll(required, provided) -> None: ... + def names(required, provided) -> None: ... + def subscribe(required, provided, subscriber) -> None: ... + def subscribed(required, provided, subscriber) -> None: ... + def subscriptions(required, provided) -> None: ... + def subscribers(objects, provided) -> None: ... class ComponentLookupError(LookupError): ... class Invalid(Exception): ... class IObjectEvent(Interface): - object: Any = ... + object: Incomplete class ObjectEvent: - object: Any = ... - def __init__(self, object: Any) -> None: ... + object: Incomplete + def __init__(self, object) -> None: ... class IComponentLookup(Interface): - adapters: Any = ... - utilities: Any = ... - def queryAdapter(object: Any, interface: Any, name: Any = ..., default: Optional[Any] = ...) -> None: ... - def getAdapter(object: Any, interface: Any, name: Any = ...) -> None: ... - def queryMultiAdapter(objects: Any, interface: Any, name: Any = ..., default: Optional[Any] = ...) -> None: ... - def getMultiAdapter(objects: Any, interface: Any, name: Any = ...) -> None: ... - def getAdapters(objects: Any, provided: Any) -> None: ... - def subscribers(objects: Any, provided: Any) -> None: ... - def handle(*objects: Any) -> None: ... - def queryUtility(interface: Any, name: str = ..., default: Optional[Any] = ...) -> None: ... - def getUtilitiesFor(interface: Any) -> None: ... - def getAllUtilitiesRegisteredFor(interface: Any) -> None: ... + adapters: Incomplete + utilities: Incomplete + def queryAdapter(object, interface, name: str = ..., default: Incomplete | None = ...) -> None: ... + def getAdapter(object, interface, name: str = ...) -> None: ... + def queryMultiAdapter(objects, interface, name: str = ..., default: Incomplete | None = ...) -> None: ... + def getMultiAdapter(objects, interface, name: str = ...) -> None: ... + def getAdapters(objects, provided) -> None: ... + def subscribers(objects, provided) -> None: ... + def handle(*objects) -> None: ... + def queryUtility(interface, name: str = ..., default: Incomplete | None = ...) -> None: ... + def getUtilitiesFor(interface) -> None: ... + def getAllUtilitiesRegisteredFor(interface) -> None: ... class IRegistration(Interface): - registry: Any = ... - name: Any = ... - info: Any = ... + registry: Incomplete + name: Incomplete + info: Incomplete class IUtilityRegistration(IRegistration): - factory: Any = ... - component: Any = ... - provided: Any = ... + factory: Incomplete + component: Incomplete + provided: Incomplete class _IBaseAdapterRegistration(IRegistration): - factory: Any = ... - required: Any = ... - provided: Any = ... + factory: Incomplete + required: Incomplete + provided: Incomplete class IAdapterRegistration(_IBaseAdapterRegistration): ... class ISubscriptionAdapterRegistration(_IBaseAdapterRegistration): ... class IHandlerRegistration(IRegistration): - handler: Any = ... - required: Any = ... + handler: Incomplete + required: Incomplete class IRegistrationEvent(IObjectEvent): ... class RegistrationEvent(ObjectEvent): ... @@ -139,17 +142,17 @@ class IUnregistered(IRegistrationEvent): ... class Unregistered(RegistrationEvent): ... class IComponentRegistry(Interface): - def registerUtility(component: Optional[Any] = ..., provided: Optional[Any] = ..., name: Any = ..., info: Any = ..., factory: Optional[Any] = ...) -> None: ... - def unregisterUtility(component: Optional[Any] = ..., provided: Optional[Any] = ..., name: Any = ..., factory: Optional[Any] = ...) -> None: ... + def registerUtility(component: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., info: str = ..., factory: Incomplete | None = ...) -> None: ... + def unregisterUtility(component: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., factory: Incomplete | None = ...) -> None: ... def registeredUtilities() -> None: ... - def registerAdapter(factory: Any, required: Optional[Any] = ..., provided: Optional[Any] = ..., name: Any = ..., info: Any = ...) -> None: ... - def unregisterAdapter(factory: Optional[Any] = ..., required: Optional[Any] = ..., provided: Optional[Any] = ..., name: Any = ...) -> None: ... + def registerAdapter(factory, required: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., info: str = ...) -> None: ... + def unregisterAdapter(factory: Incomplete | None = ..., required: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ...) -> None: ... def registeredAdapters() -> None: ... - def registerSubscriptionAdapter(factory: Any, required: Optional[Any] = ..., provides: Optional[Any] = ..., name: Any = ..., info: str = ...) -> None: ... - def unregisterSubscriptionAdapter(factory: Optional[Any] = ..., required: Optional[Any] = ..., provides: Optional[Any] = ..., name: Any = ...) -> None: ... + def registerSubscriptionAdapter(factory, required: Incomplete | None = ..., provides: Incomplete | None = ..., name: str = ..., info: str = ...) -> None: ... + def unregisterSubscriptionAdapter(factory: Incomplete | None = ..., required: Incomplete | None = ..., provides: Incomplete | None = ..., name: str = ...) -> None: ... def registeredSubscriptionAdapters() -> None: ... - def registerHandler(handler: Any, required: Optional[Any] = ..., name: Any = ..., info: str = ...) -> None: ... - def unregisterHandler(handler: Optional[Any] = ..., required: Optional[Any] = ..., name: Any = ...) -> None: ... + def registerHandler(handler, required: Incomplete | None = ..., name: str = ..., info: str = ...) -> None: ... + def unregisterHandler(handler: Incomplete | None = ..., required: Incomplete | None = ..., name: str = ...) -> None: ... def registeredHandlers() -> None: ... class IComponents(IComponentLookup, IComponentRegistry): ... diff --git a/src/zope-stubs/interface/registry.pyi b/src/zope-stubs/interface/registry.pyi index b008a58..625d652 100644 --- a/src/zope-stubs/interface/registry.pyi +++ b/src/zope-stubs/interface/registry.pyi @@ -1,75 +1,75 @@ -# Stubs for zope.interface.registry (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Generic, Iterator, Optional, Type, TypeVar, Tuple +from _typeshed import Incomplete +from collections.abc import Generator +from typing import Iterator, Optional, Type, TypeVar, Tuple T = TypeVar("T") + class _UnhashableComponentCounter: - def __init__(self, otherdict: Any) -> None: ... - def __getitem__(self, key: Any): ... - def __setitem__(self, component: Any, count: Any): ... - def __delitem__(self, component: Any): ... + def __init__(self, otherdict) -> None: ... + def __getitem__(self, key): ... + def __setitem__(self, component, count) -> None: ... + def __delitem__(self, component) -> None: ... class _UtilityRegistrations: - def __init__(self, utilities: Any, utility_registrations: Any) -> None: ... - def registerUtility(self, provided: Any, name: Any, component: Any, info: Any, factory: Any) -> None: ... - def unregisterUtility(self, provided: Any, name: Any, component: Any) -> None: ... + def __init__(self, utilities, utility_registrations) -> None: ... + def registerUtility(self, provided, name, component, info, factory) -> None: ... + def unregisterUtility(self, provided, name, component) -> None: ... class Components: - __name__: Any = ... - __bases__: Any = ... - def __init__(self, name: str = ..., bases: Any = ...) -> None: ... + __name__: Incomplete + __bases__: Incomplete + def __init__(self, name: str = ..., bases=...) -> None: ... def __reduce__(self): ... - def registerUtility(self, component: Optional[Any] = ..., provided: Optional[Any] = ..., name: str = ..., info: str = ..., event: bool = ..., factory: Optional[Any] = ...): ... - def unregisterUtility(self, component: Optional[Any] = ..., provided: Optional[Any] = ..., name: str = ..., factory: Optional[Any] = ...): ... - def registeredUtilities(self) -> None: ... - def queryUtility(self, provided: Type[T], name: str = ..., default: Optional[Any] = ...) -> Optional[T]: ... + def registerUtility(self, component: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., info: str = ..., event: bool = ..., factory: Incomplete | None = ...) -> None: ... + def unregisterUtility(self, component: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., factory: Incomplete | None = ...): ... + def registeredUtilities(self) -> Generator[Incomplete, None, None]: ... + def queryUtility(self, provided: Type[T], name: str = ..., default: Incomplete | None = ...) -> Optional[T]: ... def getUtility(self, provided: Type[T], name: str = ...) -> T: ... def getUtilitiesFor(self, interface: Type[T]) -> Iterator[Tuple[str, T]]: ... - def getAllUtilitiesRegisteredFor(self, interface: Any): ... - def registerAdapter(self, factory: Any, required: Optional[Any] = ..., provided: Optional[Any] = ..., name: str = ..., info: str = ..., event: bool = ...) -> None: ... - def unregisterAdapter(self, factory: Optional[Any] = ..., required: Optional[Any] = ..., provided: Optional[Any] = ..., name: str = ...): ... - def registeredAdapters(self) -> None: ... - def queryAdapter(self, object: Any, interface: Type[T], name: str = ..., default: Optional[Any] = ...) -> Optional[T]: ... - def getAdapter(self, object: Any, interface: Type[T], name: str = ...) -> T: ... - def queryMultiAdapter(self, objects: Any, interface: Type[T], name: str = ..., default: Optional[Any] = ...) -> Optional[T]: ... - def getMultiAdapter(self, objects: Any, interface: Type[T], name: str = ...) -> T: ... - def getAdapters(self, objects: Any, provided: Type[T]) -> Iterator[Tuple[str, T]]: ... - def registerSubscriptionAdapter(self, factory: Any, required: Optional[Any] = ..., provided: Optional[Any] = ..., name: str = ..., info: str = ..., event: bool = ...) -> None: ... - def registeredSubscriptionAdapters(self) -> None: ... - def unregisterSubscriptionAdapter(self, factory: Optional[Any] = ..., required: Optional[Any] = ..., provided: Optional[Any] = ..., name: str = ...): ... - def subscribers(self, objects: Any, provided: Type[T]) -> T: ... - def registerHandler(self, factory: Any, required: Optional[Any] = ..., name: str = ..., info: str = ..., event: bool = ...) -> None: ... - def registeredHandlers(self) -> None: ... - def unregisterHandler(self, factory: Optional[Any] = ..., required: Optional[Any] = ..., name: str = ...): ... - def handle(self, *objects: Any) -> None: ... + def getAllUtilitiesRegisteredFor(self, interface): ... + def registerAdapter(self, factory, required: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., info: str = ..., event: bool = ...) -> None: ... + def unregisterAdapter(self, factory: Incomplete | None = ..., required: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ...): ... + def registeredAdapters(self) -> Generator[Incomplete, None, None]: ... + def queryAdapter(self, object, interface: Type[T], name: str = ..., default: Incomplete | None = ...) -> Optional[T]: ... + def getAdapter(self, object, interface: Type[T], name: str = ...) -> T: ... + def queryMultiAdapter(self, objects, interface: Type[T], name: str = ..., default: Incomplete | None = ...) -> Optional[T]: ... + def getMultiAdapter(self, objects, interface: Type[T], name: str = ...) -> T: ... + def getAdapters(self, objects, provided: Type[T]) -> Iterator[Tuple[str, T]]: ... + def registerSubscriptionAdapter(self, factory, required: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ..., info: str = ..., event: bool = ...) -> None: ... + def registeredSubscriptionAdapters(self) -> Generator[Incomplete, None, None]: ... + def unregisterSubscriptionAdapter(self, factory: Incomplete | None = ..., required: Incomplete | None = ..., provided: Incomplete | None = ..., name: str = ...): ... + def subscribers(self, objects, provided: Type[T]) -> T: ... + def registerHandler(self, factory, required: Incomplete | None = ..., name: str = ..., info: str = ..., event: bool = ...) -> None: ... + def registeredHandlers(self) -> Generator[Incomplete, None, None]: ... + def unregisterHandler(self, factory: Incomplete | None = ..., required: Incomplete | None = ..., name: str = ...): ... + def handle(self, *objects) -> None: ... + def rebuildUtilityRegistryFromLocalCache(self, rebuild: bool = ...): ... class UtilityRegistration: - def __init__(self, registry: Any, provided: Any, name: Any, component: Any, doc: Any, factory: Optional[Any] = ...) -> None: ... + def __init__(self, registry, provided, name, component, doc, factory: Incomplete | None = ...) -> None: ... def __hash__(self): ... - def __eq__(self, other: Any): ... - def __ne__(self, other: Any): ... - def __lt__(self, other: Any): ... - def __le__(self, other: Any): ... - def __gt__(self, other: Any): ... - def __ge__(self, other: Any): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... class AdapterRegistration: - def __init__(self, registry: Any, required: Any, provided: Any, name: Any, component: Any, doc: Any) -> None: ... + def __init__(self, registry, required, provided, name, component, doc) -> None: ... def __hash__(self): ... - def __eq__(self, other: Any): ... - def __ne__(self, other: Any): ... - def __lt__(self, other: Any): ... - def __le__(self, other: Any): ... - def __gt__(self, other: Any): ... - def __ge__(self, other: Any): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... class SubscriptionRegistration(AdapterRegistration): ... class HandlerRegistration(AdapterRegistration): - def __init__(self, registry: Any, required: Any, name: Any, handler: Any, doc: Any) -> None: ... + def __init__(self, registry, required, name, handler, doc) -> None: ... @property def factory(self): ... - provided: Any = ... + provided: Incomplete diff --git a/src/zope-stubs/interface/ro.pyi b/src/zope-stubs/interface/ro.pyi index f5856d7..f8eefda 100644 --- a/src/zope-stubs/interface/ro.pyi +++ b/src/zope-stubs/interface/ro.pyi @@ -1,9 +1,73 @@ -# Stubs for zope.interface.ro (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from _typeshed import Incomplete -from typing import Any +class InconsistentResolutionOrderWarning(PendingDeprecationWarning): ... -__docformat__: str +class InconsistentResolutionOrderError(TypeError): + C: Incomplete + base_ros: Incomplete + base_tree_remaining: Incomplete + def __init__(self, c3, base_tree_remaining) -> None: ... -def ro(object: Any): ... +class _NamedBool(int): + def __new__(cls, val, name): ... + +class _ClassBoolFromEnv: + def __get__(self, inst, klass): ... + +class _StaticMRO: + had_inconsistency: Incomplete + leaf: Incomplete + def __init__(self, C, mro) -> None: ... + def mro(self): ... + +class C3: + @staticmethod + def resolver(C, strict, base_mros): ... + direct_inconsistency: bool + leaf: Incomplete + memo: Incomplete + base_tree: Incomplete + bases_had_inconsistency: Incomplete + def __init__(self, C, memo) -> None: ... + @property + def had_inconsistency(self): ... + @property + def legacy_ro(self): ... + TRACK_BAD_IRO: Incomplete + STRICT_IRO: Incomplete + WARN_BAD_IRO: Incomplete + LOG_CHANGED_IRO: Incomplete + USE_LEGACY_IRO: Incomplete + BAD_IROS: Incomplete + class _UseLegacyRO(Exception): ... + def mro(self): ... + +class _StrictC3(C3): ... +class _TrackingC3(C3): ... + +class _ROComparison: + class Item: + prefix: str + item: Incomplete + def __init__(self, item) -> None: ... + class Deleted(Item): + prefix: str + class Inserted(Item): + prefix: str + Empty = str + class ReplacedBy: + prefix: str + suffix: str + chunk: Incomplete + total_count: Incomplete + def __init__(self, chunk, total_count) -> None: ... + def __iter__(self): ... + class Replacing(ReplacedBy): + prefix: str + suffix: str + c3: Incomplete + c3_ro: Incomplete + legacy_ro: Incomplete + def __init__(self, c3, c3_ro, legacy_ro) -> None: ... + +def ro(C, strict: Incomplete | None = ..., base_mros: Incomplete | None = ..., log_changed_ro: Incomplete | None = ..., use_legacy_ro: Incomplete | None = ...): ... diff --git a/src/zope-stubs/interface/verify.pyi b/src/zope-stubs/interface/verify.pyi index 347bb79..5e74406 100644 --- a/src/zope-stubs/interface/verify.pyi +++ b/src/zope-stubs/interface/verify.pyi @@ -1,10 +1,2 @@ -# Stubs for zope.interface.verify (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -MethodTypes: Any - -def verifyClass(iface: Any, candidate: Any, tentative: int = ...): ... -def verifyObject(iface: Any, candidate: Any, tentative: int = ...): ... +def verifyClass(iface, candidate, tentative: bool = ...): ... +def verifyObject(iface, candidate, tentative: bool = ...): ... diff --git a/tests/samples/custom_sequence.py b/tests/samples/custom_sequence.py new file mode 100644 index 0000000..6073545 --- /dev/null +++ b/tests/samples/custom_sequence.py @@ -0,0 +1,20 @@ +"""Override a sequence interface""" + +from zope.interface.common import sequence + +class ICustomSequence(sequence.IFiniteSequence): + def iterator(first, count): + pass + + def size() -> int: + pass + +seq = object() +assert ICustomSequence.providedBy(seq) +reveal_type(seq.size()) + +""" + +custom_sequence.py:14: note: Revealed type is "builtins.int" + +"""