Skip to content

Wrong type hint on idna.encode return #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pullpush-io opened this issue Mar 12, 2025 · 1 comment · Fixed by #107
Closed

Wrong type hint on idna.encode return #106

pullpush-io opened this issue Mar 12, 2025 · 1 comment · Fixed by #107

Comments

@pullpush-io
Copy link

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

@bbayles
Copy link
Collaborator

bbayles commented Mar 12, 2025

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants