Skip to content

Wrong type hint on idna.encode return #106

@pullpush-io

Description

@pullpush-io
Python 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ada_url import URL, idna
>>> idna.encode('example.com')
b'example.com'
>>> idna.encode('фси.рф')
b'xn--h1ari.xn--p1ai'
>>> 

return ffi.string(val.data, val.length) if val.length else b''

Type hint is str while return value seems to bytes

Activity

bbayles

bbayles commented on Mar 12, 2025

@bbayles
Collaborator

Thanks for the report. I made this PR to fix the issue: #107

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @bbayles@pullpush-io

      Issue actions

        Wrong type hint on idna.encode return · Issue #106 · ada-url/ada-python