-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
The docstring of SequenceOf in https://github.com/pyasn1/pyasn1/blob/2d2d8cfcf9bf2e9e7119efced7d57939a63b9605/pyasn1/type/univ.py#L1659C1-L1668C44 reads as follows:
from pyasn1.type.univ import SequenceOf, SetOf, Integer
class LotteryDraw(SequenceOf): # SetOf is similar
'''
ASN.1 specification:
LotteryDraw ::= SEQUENCE OF INTEGER
'''
componentType = Integer()
lotteryDraw = LotteryDraw()
lotteryDraw.extend([123, 456, 789])and with pyasn1==0.6.2 types-pyasn1==0.6.0.20250914 and mypy 1.19.1 (compiled: yes) I get this error:
test.py:8: error: Incompatible types in assignment (expression has type "Integer", base class "SequenceOfAndSetOfBase" defined the type as "Optional[NamedTypes]") [assignment]
Found 1 error in 1 file (checked 1 source file)
Same applies with SetOf, by the way.
Metadata
Metadata
Assignees
Labels
No labels