diff --git a/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi b/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi index 234278305ee6..28156078ceb3 100644 --- a/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi @@ -1,8 +1,9 @@ -from abc import ABC, abstractmethod +from _typeshed import Incomplete +from abc import abstractmethod from pyasn1.type.base import Asn1Type -class AbstractItemEncoder(ABC): +class AbstractItemEncoder: supportIndefLenMode: bool eooIntegerSubstrate: tuple[int, int] eooOctetsSubstrate: bytes @@ -10,7 +11,7 @@ class AbstractItemEncoder(ABC): def encodeLength(self, length, defMode): ... @abstractmethod def encodeValue(self, value, asn1Spec, encodeFun, **options) -> None: ... - def encode(self, value, asn1Spec: Asn1Type | None = ..., encodeFun: object | None = ..., **options): ... + def encode(self, value, asn1Spec: Asn1Type | None = ..., encodeFun: Incomplete | None = ..., **options): ... class EndOfOctetsEncoder(AbstractItemEncoder): def encodeValue(self, value, asn1Spec, encodeFun, **options): ... diff --git a/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi b/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi index 9a4adaab9562..3b01db7d4e29 100644 --- a/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi @@ -1,3 +1,5 @@ +from typing import ClassVar + from pyasn1.codec.ber import encoder class BooleanEncoder(encoder.IntegerEncoder): @@ -6,23 +8,18 @@ class BooleanEncoder(encoder.IntegerEncoder): class RealEncoder(encoder.RealEncoder): ... class TimeEncoderMixIn: - Z_CHAR: int - PLUS_CHAR: int - MINUS_CHAR: int - COMMA_CHAR: int - DOT_CHAR: int - ZERO_CHAR: int - MIN_LENGTH: int - MAX_LENGTH: int + Z_CHAR: ClassVar[int] + PLUS_CHAR: ClassVar[int] + MINUS_CHAR: ClassVar[int] + COMMA_CHAR: ClassVar[int] + DOT_CHAR: ClassVar[int] + ZERO_CHAR: ClassVar[int] + MIN_LENGTH: ClassVar[int] + MAX_LENGTH: ClassVar[int] def encodeValue(self, value, asn1Spec, encodeFun, **options): ... -class GeneralizedTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): - MIN_LENGTH: int - MAX_LENGTH: int - -class UTCTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): - MIN_LENGTH: int - MAX_LENGTH: int +class GeneralizedTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): ... +class UTCTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): ... class SetOfEncoder(encoder.SequenceOfEncoder): def encodeValue(self, value, asn1Spec, encodeFun, **options): ... diff --git a/stubs/pyasn1/pyasn1/codec/native/decoder.pyi b/stubs/pyasn1/pyasn1/codec/native/decoder.pyi index 6aa0b3e8972e..47296d667536 100644 --- a/stubs/pyasn1/pyasn1/codec/native/decoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/native/decoder.pyi @@ -1,11 +1,10 @@ from _typeshed import Incomplete -from abc import ABC from collections.abc import Callable from typing_extensions import TypeAlias _Unused: TypeAlias = object -class AbstractScalarDecoder(ABC): +class AbstractScalarDecoder: def __call__(self, pyObject, asn1Spec, decodeFun: _Unused = ..., **options): ... class BitStringDecoder(AbstractScalarDecoder): diff --git a/stubs/pyasn1/pyasn1/codec/native/encoder.pyi b/stubs/pyasn1/pyasn1/codec/native/encoder.pyi index 96305e283494..ec0cb54cfd23 100644 --- a/stubs/pyasn1/pyasn1/codec/native/encoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/native/encoder.pyi @@ -1,7 +1,7 @@ -from abc import ABC, abstractmethod +from abc import abstractmethod from collections import OrderedDict -class AbstractItemEncoder(ABC): +class AbstractItemEncoder: @abstractmethod def encode(self, value, encodeFun, **options) -> None: ... diff --git a/stubs/pyasn1/pyasn1/error.pyi b/stubs/pyasn1/pyasn1/error.pyi index 3349f338f31e..97eb7898d2f2 100644 --- a/stubs/pyasn1/pyasn1/error.pyi +++ b/stubs/pyasn1/pyasn1/error.pyi @@ -3,7 +3,7 @@ class ValueConstraintError(PyAsn1Error): ... class SubstrateUnderrunError(PyAsn1Error): ... class PyAsn1UnicodeError(PyAsn1Error, UnicodeError): - def __init__(self, message, unicode_error: UnicodeError | object = ...) -> None: ... + def __init__(self, message, unicode_error: UnicodeError | None = ...) -> None: ... class PyAsn1UnicodeDecodeError(PyAsn1UnicodeError, UnicodeDecodeError): ... class PyAsn1UnicodeEncodeError(PyAsn1UnicodeError, UnicodeEncodeError): ... diff --git a/stubs/pyasn1/pyasn1/type/base.pyi b/stubs/pyasn1/pyasn1/type/base.pyi index 455f33c8aff8..81c91b2ebc92 100644 --- a/stubs/pyasn1/pyasn1/type/base.pyi +++ b/stubs/pyasn1/pyasn1/type/base.pyi @@ -104,8 +104,6 @@ class NoValue: class SimpleAsn1Type(Asn1Type): defaultValue: Incomplete | NoValue def __init__(self, value=..., **kwargs) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... @@ -128,8 +126,6 @@ class ConstructedAsn1Type(Asn1Type): componentType: namedtype.NamedTypes | None sizeSpec: constraint.ConstraintsIntersection def __init__(self, **kwargs) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... diff --git a/stubs/pyasn1/pyasn1/type/char.pyi b/stubs/pyasn1/pyasn1/type/char.pyi index 8037d673f200..b61ce2aa8129 100644 --- a/stubs/pyasn1/pyasn1/type/char.pyi +++ b/stubs/pyasn1/pyasn1/type/char.pyi @@ -1,9 +1,7 @@ -from abc import ABC - from pyasn1.type import univ from pyasn1.type.tag import TagSet -class AbstractCharacterString(univ.OctetString, ABC): +class AbstractCharacterString(univ.OctetString): def __bytes__(self) -> bytes: ... def prettyIn(self, value): ... def asOctets(self, padding: bool = ...): ... @@ -13,75 +11,62 @@ class AbstractCharacterString(univ.OctetString, ABC): def __reversed__(self): ... class NumericString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class PrintableString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class TeletexString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class T61String(TeletexString): - __doc__: str typeId: int class VideotexString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class IA5String(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class GraphicString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class VisibleString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class ISO646String(VisibleString): - __doc__: str typeId: int class GeneralString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class UniversalString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class BMPString(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int class UTF8String(AbstractCharacterString): - __doc__: str tagSet: TagSet encoding: str typeId: int diff --git a/stubs/pyasn1/pyasn1/type/constraint.pyi b/stubs/pyasn1/pyasn1/type/constraint.pyi index 2bb1e8bb21b5..6530f1b96b1e 100644 --- a/stubs/pyasn1/pyasn1/type/constraint.pyi +++ b/stubs/pyasn1/pyasn1/type/constraint.pyi @@ -1,10 +1,6 @@ -from abc import ABC - -class AbstractConstraint(ABC): +class AbstractConstraint: def __init__(self, *values) -> None: ... def __call__(self, value, idx: int | None = ...) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... @@ -31,7 +27,7 @@ class WithComponentsConstraint(AbstractConstraint): ... class InnerTypeConstraint(AbstractConstraint): ... class ConstraintsExclusion(AbstractConstraint): ... -class AbstractConstraintSet(AbstractConstraint, ABC): +class AbstractConstraintSet(AbstractConstraint): def __getitem__(self, idx): ... def __iter__(self): ... def __add__(self, value): ... diff --git a/stubs/pyasn1/pyasn1/type/namedtype.pyi b/stubs/pyasn1/pyasn1/type/namedtype.pyi index 5d3e806bad4a..a8fb283d73b4 100644 --- a/stubs/pyasn1/pyasn1/type/namedtype.pyi +++ b/stubs/pyasn1/pyasn1/type/namedtype.pyi @@ -2,8 +2,6 @@ class NamedType: isOptional: bool isDefaulted: bool def __init__(self, name, asn1Object, openType: type | None = ...) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... @@ -21,17 +19,13 @@ class NamedType: def getType(self): ... class OptionalNamedType(NamedType): - __doc__: str isOptional: bool class DefaultedNamedType(NamedType): - __doc__: str isDefaulted: bool class NamedTypes: def __init__(self, *namedTypes, **kwargs) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... diff --git a/stubs/pyasn1/pyasn1/type/namedval.pyi b/stubs/pyasn1/pyasn1/type/namedval.pyi index 348fb9174417..a6b1873da804 100644 --- a/stubs/pyasn1/pyasn1/type/namedval.pyi +++ b/stubs/pyasn1/pyasn1/type/namedval.pyi @@ -3,8 +3,6 @@ from collections.abc import Generator class NamedValues: def __init__(self, *args, **kwargs) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... diff --git a/stubs/pyasn1/pyasn1/type/tag.pyi b/stubs/pyasn1/pyasn1/type/tag.pyi index 8c484dd60301..6599bac1e1de 100644 --- a/stubs/pyasn1/pyasn1/type/tag.pyi +++ b/stubs/pyasn1/pyasn1/type/tag.pyi @@ -10,8 +10,6 @@ tagCategoryUntagged: int class Tag: def __init__(self, tagClass, tagFormat, tagId) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... @@ -33,8 +31,6 @@ class TagSet: def __add__(self, superTag): ... def __radd__(self, superTag): ... def __getitem__(self, i): ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... diff --git a/stubs/pyasn1/pyasn1/type/univ.pyi b/stubs/pyasn1/pyasn1/type/univ.pyi index 5dd9b1b91821..a44beada092f 100644 --- a/stubs/pyasn1/pyasn1/type/univ.pyi +++ b/stubs/pyasn1/pyasn1/type/univ.pyi @@ -54,12 +54,10 @@ class Integer(base.SimpleAsn1Type): def __floor__(self): ... def __ceil__(self): ... def __trunc__(self): ... - def __lt__(self, value): ... - def __le__(self, value): ... - def __eq__(self, value): ... - def __ne__(self, value): ... - def __gt__(self, value): ... - def __ge__(self, value): ... + def __lt__(self, value) -> bool: ... + def __le__(self, value) -> bool: ... + def __gt__(self, value) -> bool: ... + def __ge__(self, value) -> bool: ... def prettyIn(self, value): ... def prettyOut(self, value): ... def getNamedValues(self): ... @@ -86,8 +84,6 @@ class BitString(base.SimpleAsn1Type): defaultBinValue: str | base.NoValue defaultHexValue: str | base.NoValue def __init__(self, value=..., **kwargs) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... @@ -207,8 +203,6 @@ class Real(base.SimpleAsn1Type): def __trunc__(self): ... def __lt__(self, value): ... def __le__(self, value): ... - def __eq__(self, value): ... - def __ne__(self, value): ... def __gt__(self, value): ... def __ge__(self, value): ... def __bool__(self) -> bool: ... @@ -263,11 +257,9 @@ class SequenceOfAndSetOfBase(base.ConstructedAsn1Type): def isInconsistent(self): ... class SequenceOf(SequenceOfAndSetOfBase): - __doc__: str typeId: int class SetOf(SequenceOfAndSetOfBase): - __doc__: str typeId: int class SequenceAndSetBase(base.ConstructedAsn1Type): @@ -316,7 +308,6 @@ class SequenceAndSetBase(base.ConstructedAsn1Type): def getNameByPosition(self, idx): ... class Sequence(SequenceAndSetBase): - __doc__: str tagSet: TagSet subtypeSpec: constraint.ConstraintsIntersection componentType: namedtype.NamedTypes @@ -325,7 +316,6 @@ class Sequence(SequenceAndSetBase): def getComponentPositionNearType(self, tagSet, idx): ... class Set(SequenceAndSetBase): - __doc__: str tagSet: TagSet componentType: namedtype.NamedTypes subtypeSpec: constraint.ConstraintsIntersection @@ -349,8 +339,6 @@ class Choice(Set): componentType: namedtype.NamedTypes subtypeSpec: constraint.ConstraintsIntersection typeId: int - def __eq__(self, other): ... - def __ne__(self, other): ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... diff --git a/stubs/pyasn1/pyasn1/type/useful.pyi b/stubs/pyasn1/pyasn1/type/useful.pyi index 4a4179c46d06..33f13a33a061 100644 --- a/stubs/pyasn1/pyasn1/type/useful.pyi +++ b/stubs/pyasn1/pyasn1/type/useful.pyi @@ -4,7 +4,6 @@ from pyasn1.type import char from pyasn1.type.tag import TagSet class ObjectDescriptor(char.GraphicString): - __doc__: str tagSet: TagSet typeId: int @@ -21,11 +20,9 @@ class TimeMixIn: def fromDateTime(cls, dt): ... class GeneralizedTime(char.VisibleString, TimeMixIn): - __doc__: str tagSet: TagSet typeId: int class UTCTime(char.VisibleString, TimeMixIn): - __doc__: str tagSet: TagSet typeId: int