Skip to content

refactor(codecs.ber.encode): add basic return type annotations - #131

Open
spaceone wants to merge 1 commit into
pyasn1:mainfrom
Free-IAM:refactor/codec-ber-type-annotations
Open

spaceone wants to merge 1 commit into
pyasn1:mainfrom
Free-IAM:refactor/codec-ber-type-annotations

Conversation

@spaceone

Copy link
Copy Markdown

python-ldap recently added type annotations. To support mypy it added a lot of type-ignore comments. They are incompatible with the ty-type-checker.

Example:

    def encodeControlValue(self) -> bytes:
        return encoder.encode(self._derefSpecs())  # type: ignore

I want to get rid of these type-ignore comments.
I can explicitly use a return cast(bytes, encoder.encode(self._derefSpecs())).

but the long-term solution would be to just integrate it here.

@spaceone
spaceone force-pushed the refactor/codec-ber-type-annotations branch 2 times, most recently from 8b7e55d to 675108b Compare October 21, 2026 22:38
@spaceone

Copy link
Copy Markdown
Author

See also python/typeshed#16589

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.

1 participant