Skip to content

Wrong type hint on idna.encode return #106

Closed
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions