-
Notifications
You must be signed in to change notification settings - Fork 232
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
Ensure that secretbox can accept any bytes-like object as parameter #847
base: main
Are you sure you want to change the base?
Conversation
d39a50d
to
7e60497
Compare
7e60497
to
263f9c9
Compare
Please pardon the force pushes. I'm also happy to remove mypy from I was able to use uv to do most of my iteration here, but not having an explicit version of |
5af8b43
to
0c35533
Compare
@blast-hardcheese are you interested in implementing this across the set of methods? If so, we should set up an issue to track everything and burn it down. I've been meaning to ship a new PyNaCl release for a while, so it'd be nice to get this in there 🙂 |
I'm not opposed to it, I figured I'd start with the ones that were causing me pain. Is it sufficient to apply this pattern to all public methods? |
Yes, this pattern is correct for any immutable buffers being passed into the C layer. |
start to address #707, ensuring that secretbox can accept
bytearray
.The issue I ran into in this case was that both mypy and pyright think that
bytearray
satisfybytes
. Taking the suggestion from #707 resolved this in tests.Thank you for the library!