Skip to content

Commit b26e252

Browse files
committed
PR comments
1 parent cac4f6b commit b26e252

File tree

13 files changed

+27
-80
lines changed

13 files changed

+27
-80
lines changed

stubs/pyasn1/pyasn1/codec/ber/encoder.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
from abc import ABC, abstractmethod
1+
from _typeshed import Incomplete
2+
from abc import abstractmethod
23

34
from pyasn1.type.base import Asn1Type
45

5-
class AbstractItemEncoder(ABC):
6+
class AbstractItemEncoder:
67
supportIndefLenMode: bool
78
eooIntegerSubstrate: tuple[int, int]
89
eooOctetsSubstrate: bytes
910
def encodeTag(self, singleTag, isConstructed): ...
1011
def encodeLength(self, length, defMode): ...
1112
@abstractmethod
1213
def encodeValue(self, value, asn1Spec, encodeFun, **options) -> None: ...
13-
def encode(self, value, asn1Spec: Asn1Type | None = ..., encodeFun: object | None = ..., **options): ...
14+
def encode(self, value, asn1Spec: Asn1Type | None = ..., encodeFun: Incomplete | None = ..., **options): ...
1415

1516
class EndOfOctetsEncoder(AbstractItemEncoder):
1617
def encodeValue(self, value, asn1Spec, encodeFun, **options): ...

stubs/pyasn1/pyasn1/codec/cer/encoder.pyi

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import ClassVar
2+
13
from pyasn1.codec.ber import encoder
24

35
class BooleanEncoder(encoder.IntegerEncoder):
@@ -6,23 +8,18 @@ class BooleanEncoder(encoder.IntegerEncoder):
68
class RealEncoder(encoder.RealEncoder): ...
79

810
class TimeEncoderMixIn:
9-
Z_CHAR: int
10-
PLUS_CHAR: int
11-
MINUS_CHAR: int
12-
COMMA_CHAR: int
13-
DOT_CHAR: int
14-
ZERO_CHAR: int
15-
MIN_LENGTH: int
16-
MAX_LENGTH: int
11+
Z_CHAR: ClassVar[int]
12+
PLUS_CHAR: ClassVar[int]
13+
MINUS_CHAR: ClassVar[int]
14+
COMMA_CHAR: ClassVar[int]
15+
DOT_CHAR: ClassVar[int]
16+
ZERO_CHAR: ClassVar[int]
17+
MIN_LENGTH: ClassVar[int]
18+
MAX_LENGTH: ClassVar[int]
1719
def encodeValue(self, value, asn1Spec, encodeFun, **options): ...
1820

19-
class GeneralizedTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder):
20-
MIN_LENGTH: int
21-
MAX_LENGTH: int
22-
23-
class UTCTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder):
24-
MIN_LENGTH: int
25-
MAX_LENGTH: int
21+
class GeneralizedTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): ...
22+
class UTCTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): ...
2623

2724
class SetOfEncoder(encoder.SequenceOfEncoder):
2825
def encodeValue(self, value, asn1Spec, encodeFun, **options): ...

stubs/pyasn1/pyasn1/codec/native/decoder.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from _typeshed import Incomplete
2-
from abc import ABC
32
from collections.abc import Callable
43
from typing_extensions import TypeAlias
54

65
_Unused: TypeAlias = object
76

8-
class AbstractScalarDecoder(ABC):
7+
class AbstractScalarDecoder:
98
def __call__(self, pyObject, asn1Spec, decodeFun: _Unused = ..., **options): ...
109

1110
class BitStringDecoder(AbstractScalarDecoder):

stubs/pyasn1/pyasn1/codec/native/encoder.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from abc import ABC, abstractmethod
1+
from abc import abstractmethod
22
from collections import OrderedDict
33

4-
class AbstractItemEncoder(ABC):
4+
class AbstractItemEncoder:
55
@abstractmethod
66
def encode(self, value, encodeFun, **options) -> None: ...
77

stubs/pyasn1/pyasn1/error.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class ValueConstraintError(PyAsn1Error): ...
33
class SubstrateUnderrunError(PyAsn1Error): ...
44

55
class PyAsn1UnicodeError(PyAsn1Error, UnicodeError):
6-
def __init__(self, message, unicode_error: UnicodeError | object = ...) -> None: ...
6+
def __init__(self, message, unicode_error: UnicodeError | None = ...) -> None: ...
77

88
class PyAsn1UnicodeDecodeError(PyAsn1UnicodeError, UnicodeDecodeError): ...
99
class PyAsn1UnicodeEncodeError(PyAsn1UnicodeError, UnicodeEncodeError): ...

stubs/pyasn1/pyasn1/type/base.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ class NoValue:
104104
class SimpleAsn1Type(Asn1Type):
105105
defaultValue: Incomplete | NoValue
106106
def __init__(self, value=..., **kwargs) -> None: ...
107-
def __eq__(self, other): ...
108-
def __ne__(self, other): ...
109107
def __lt__(self, other): ...
110108
def __le__(self, other): ...
111109
def __gt__(self, other): ...
@@ -128,8 +126,6 @@ class ConstructedAsn1Type(Asn1Type):
128126
componentType: namedtype.NamedTypes | None
129127
sizeSpec: constraint.ConstraintsIntersection
130128
def __init__(self, **kwargs) -> None: ...
131-
def __eq__(self, other): ...
132-
def __ne__(self, other): ...
133129
def __lt__(self, other): ...
134130
def __le__(self, other): ...
135131
def __gt__(self, other): ...

stubs/pyasn1/pyasn1/type/char.pyi

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from abc import ABC
2-
31
from pyasn1.type import univ
42
from pyasn1.type.tag import TagSet
53

6-
class AbstractCharacterString(univ.OctetString, ABC):
4+
class AbstractCharacterString(univ.OctetString):
75
def __bytes__(self) -> bytes: ...
86
def prettyIn(self, value): ...
97
def asOctets(self, padding: bool = ...): ...
@@ -13,75 +11,62 @@ class AbstractCharacterString(univ.OctetString, ABC):
1311
def __reversed__(self): ...
1412

1513
class NumericString(AbstractCharacterString):
16-
__doc__: str
1714
tagSet: TagSet
1815
encoding: str
1916
typeId: int
2017

2118
class PrintableString(AbstractCharacterString):
22-
__doc__: str
2319
tagSet: TagSet
2420
encoding: str
2521
typeId: int
2622

2723
class TeletexString(AbstractCharacterString):
28-
__doc__: str
2924
tagSet: TagSet
3025
encoding: str
3126
typeId: int
3227

3328
class T61String(TeletexString):
34-
__doc__: str
3529
typeId: int
3630

3731
class VideotexString(AbstractCharacterString):
38-
__doc__: str
3932
tagSet: TagSet
4033
encoding: str
4134
typeId: int
4235

4336
class IA5String(AbstractCharacterString):
44-
__doc__: str
4537
tagSet: TagSet
4638
encoding: str
4739
typeId: int
4840

4941
class GraphicString(AbstractCharacterString):
50-
__doc__: str
5142
tagSet: TagSet
5243
encoding: str
5344
typeId: int
5445

5546
class VisibleString(AbstractCharacterString):
56-
__doc__: str
5747
tagSet: TagSet
5848
encoding: str
5949
typeId: int
6050

6151
class ISO646String(VisibleString):
62-
__doc__: str
6352
typeId: int
6453

6554
class GeneralString(AbstractCharacterString):
66-
__doc__: str
6755
tagSet: TagSet
6856
encoding: str
6957
typeId: int
7058

7159
class UniversalString(AbstractCharacterString):
72-
__doc__: str
7360
tagSet: TagSet
7461
encoding: str
7562
typeId: int
7663

7764
class BMPString(AbstractCharacterString):
78-
__doc__: str
7965
tagSet: TagSet
8066
encoding: str
8167
typeId: int
8268

8369
class UTF8String(AbstractCharacterString):
84-
__doc__: str
8570
tagSet: TagSet
8671
encoding: str
8772
typeId: int

stubs/pyasn1/pyasn1/type/constraint.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
from abc import ABC
2-
3-
class AbstractConstraint(ABC):
1+
class AbstractConstraint:
42
def __init__(self, *values) -> None: ...
53
def __call__(self, value, idx: int | None = ...) -> None: ...
6-
def __eq__(self, other): ...
7-
def __ne__(self, other): ...
84
def __lt__(self, other): ...
95
def __le__(self, other): ...
106
def __gt__(self, other): ...
@@ -31,7 +27,7 @@ class WithComponentsConstraint(AbstractConstraint): ...
3127
class InnerTypeConstraint(AbstractConstraint): ...
3228
class ConstraintsExclusion(AbstractConstraint): ...
3329

34-
class AbstractConstraintSet(AbstractConstraint, ABC):
30+
class AbstractConstraintSet(AbstractConstraint):
3531
def __getitem__(self, idx): ...
3632
def __iter__(self): ...
3733
def __add__(self, value): ...

stubs/pyasn1/pyasn1/type/namedtype.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ class NamedType:
22
isOptional: bool
33
isDefaulted: bool
44
def __init__(self, name, asn1Object, openType: type | None = ...) -> None: ...
5-
def __eq__(self, other): ...
6-
def __ne__(self, other): ...
75
def __lt__(self, other): ...
86
def __le__(self, other): ...
97
def __gt__(self, other): ...
@@ -21,17 +19,13 @@ class NamedType:
2119
def getType(self): ...
2220

2321
class OptionalNamedType(NamedType):
24-
__doc__: str
2522
isOptional: bool
2623

2724
class DefaultedNamedType(NamedType):
28-
__doc__: str
2925
isDefaulted: bool
3026

3127
class NamedTypes:
3228
def __init__(self, *namedTypes, **kwargs) -> None: ...
33-
def __eq__(self, other): ...
34-
def __ne__(self, other): ...
3529
def __lt__(self, other): ...
3630
def __le__(self, other): ...
3731
def __gt__(self, other): ...

stubs/pyasn1/pyasn1/type/namedval.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ from collections.abc import Generator
33

44
class NamedValues:
55
def __init__(self, *args, **kwargs) -> None: ...
6-
def __eq__(self, other): ...
7-
def __ne__(self, other): ...
86
def __lt__(self, other): ...
97
def __le__(self, other): ...
108
def __gt__(self, other): ...

stubs/pyasn1/pyasn1/type/tag.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ tagCategoryUntagged: int
1010

1111
class Tag:
1212
def __init__(self, tagClass, tagFormat, tagId) -> None: ...
13-
def __eq__(self, other): ...
14-
def __ne__(self, other): ...
1513
def __lt__(self, other): ...
1614
def __le__(self, other): ...
1715
def __gt__(self, other): ...
@@ -33,8 +31,6 @@ class TagSet:
3331
def __add__(self, superTag): ...
3432
def __radd__(self, superTag): ...
3533
def __getitem__(self, i): ...
36-
def __eq__(self, other): ...
37-
def __ne__(self, other): ...
3834
def __lt__(self, other): ...
3935
def __le__(self, other): ...
4036
def __gt__(self, other): ...

stubs/pyasn1/pyasn1/type/univ.pyi

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ class Integer(base.SimpleAsn1Type):
5454
def __floor__(self): ...
5555
def __ceil__(self): ...
5656
def __trunc__(self): ...
57-
def __lt__(self, value): ...
58-
def __le__(self, value): ...
59-
def __eq__(self, value): ...
60-
def __ne__(self, value): ...
61-
def __gt__(self, value): ...
62-
def __ge__(self, value): ...
57+
def __lt__(self, value) -> bool: ...
58+
def __le__(self, value) -> bool: ...
59+
def __gt__(self, value) -> bool: ...
60+
def __ge__(self, value) -> bool: ...
6361
def prettyIn(self, value): ...
6462
def prettyOut(self, value): ...
6563
def getNamedValues(self): ...
@@ -86,8 +84,6 @@ class BitString(base.SimpleAsn1Type):
8684
defaultBinValue: str | base.NoValue
8785
defaultHexValue: str | base.NoValue
8886
def __init__(self, value=..., **kwargs) -> None: ...
89-
def __eq__(self, other): ...
90-
def __ne__(self, other): ...
9187
def __lt__(self, other): ...
9288
def __le__(self, other): ...
9389
def __gt__(self, other): ...
@@ -207,8 +203,6 @@ class Real(base.SimpleAsn1Type):
207203
def __trunc__(self): ...
208204
def __lt__(self, value): ...
209205
def __le__(self, value): ...
210-
def __eq__(self, value): ...
211-
def __ne__(self, value): ...
212206
def __gt__(self, value): ...
213207
def __ge__(self, value): ...
214208
def __bool__(self) -> bool: ...
@@ -263,11 +257,9 @@ class SequenceOfAndSetOfBase(base.ConstructedAsn1Type):
263257
def isInconsistent(self): ...
264258

265259
class SequenceOf(SequenceOfAndSetOfBase):
266-
__doc__: str
267260
typeId: int
268261

269262
class SetOf(SequenceOfAndSetOfBase):
270-
__doc__: str
271263
typeId: int
272264

273265
class SequenceAndSetBase(base.ConstructedAsn1Type):
@@ -316,7 +308,6 @@ class SequenceAndSetBase(base.ConstructedAsn1Type):
316308
def getNameByPosition(self, idx): ...
317309

318310
class Sequence(SequenceAndSetBase):
319-
__doc__: str
320311
tagSet: TagSet
321312
subtypeSpec: constraint.ConstraintsIntersection
322313
componentType: namedtype.NamedTypes
@@ -325,7 +316,6 @@ class Sequence(SequenceAndSetBase):
325316
def getComponentPositionNearType(self, tagSet, idx): ...
326317

327318
class Set(SequenceAndSetBase):
328-
__doc__: str
329319
tagSet: TagSet
330320
componentType: namedtype.NamedTypes
331321
subtypeSpec: constraint.ConstraintsIntersection
@@ -349,8 +339,6 @@ class Choice(Set):
349339
componentType: namedtype.NamedTypes
350340
subtypeSpec: constraint.ConstraintsIntersection
351341
typeId: int
352-
def __eq__(self, other): ...
353-
def __ne__(self, other): ...
354342
def __lt__(self, other): ...
355343
def __le__(self, other): ...
356344
def __gt__(self, other): ...

stubs/pyasn1/pyasn1/type/useful.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ from pyasn1.type import char
44
from pyasn1.type.tag import TagSet
55

66
class ObjectDescriptor(char.GraphicString):
7-
__doc__: str
87
tagSet: TagSet
98
typeId: int
109

@@ -21,11 +20,9 @@ class TimeMixIn:
2120
def fromDateTime(cls, dt): ...
2221

2322
class GeneralizedTime(char.VisibleString, TimeMixIn):
24-
__doc__: str
2523
tagSet: TagSet
2624
typeId: int
2725

2826
class UTCTime(char.VisibleString, TimeMixIn):
29-
__doc__: str
3027
tagSet: TagSet
3128
typeId: int

0 commit comments

Comments
 (0)