Skip to content

Comments

[pyasn1] Fix componentType to accept Asn1Type in SequenceOf#15442

Open
emmanuel-ferdman wants to merge 1 commit intopython:mainfrom
emmanuel-ferdman:pyasn1-componenttype
Open

[pyasn1] Fix componentType to accept Asn1Type in SequenceOf#15442
emmanuel-ferdman wants to merge 1 commit intopython:mainfrom
emmanuel-ferdman:pyasn1-componenttype

Conversation

@emmanuel-ferdman
Copy link
Contributor

PR Summary

The componentType attribute in SequenceOfAndSetOfBase was typed as NamedTypes | None, but ASN.1 SEQUENCE OF / SET OF constructs take a single Asn1Type (like Integer()), not NamedTypes. This caused false positives when subclassing SequenceOf with a component type, which is the standard usage shown in pyasn1's own documentation. The fix also removes the # type: ignore[assignment] that were added to ldap3 stubs.

Fixes #15369

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyasn1: mypy error with doc example of SequenceOf

1 participant