Skip to content
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

AES* generate_key argument name differs in actual class vs .pyi #12169

Closed
jborean93 opened this issue Dec 19, 2024 · 2 comments · Fixed by #12170
Closed

AES* generate_key argument name differs in actual class vs .pyi #12169

jborean93 opened this issue Dec 19, 2024 · 2 comments · Fixed by #12170

Comments

@jborean93
Copy link
Contributor

The definition for the AESGCM.generate_key class method defines the first argument as bit_length: usize whereas the AESGCM.generate_key pyi definition is key_size. This causes issues with mypy validation if calling this method with an explicit kwarg like

AESGCM.generate_key(bit_length=256)

There are other AES* classes that also have a bit_length argument in the source but the .pyi defines it as key_size. These should align and to avoid backwards compatibility problems the .pyi files should be changed to bit_length. If you are happy with this change I can send through a PR with those changes.

@alex
Copy link
Member

alex commented Dec 19, 2024

Sigh, good catch.

Yes, we'd be happy to take a patch, and you're correct that bit_length is the right name.

@jborean93
Copy link
Contributor Author

Have opened #12170. I'm unsure if you want a test for one or all classes to call this method with the kwarg but just left it to the .pyi changes for now.

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

Successfully merging a pull request may close this issue.

2 participants