Ensure that secretbox can accept any bytes-like object as parameter#847
Ensure that secretbox can accept any bytes-like object as parameter#847blast-hardcheese wants to merge 6 commits intopyca:mainfrom
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. |
| A very long time later I'm back around looking at these things. I'd still like to fix this systemically and I'll be happy to ship a release quickly (really!) if there's still interest in doing this for all immutable buffers. We're doing 1.6.0 shortly, but 1.7.0 with this is not a problem. |
| I've actually moved on, and I no longer have context on this. Python typechecking is an interesting space, so no doubt just running both mypy and pyright and seeing what the current state of the world looks like is a suitable next step, but I really don't know. Thank you for the library, it was helpful while I was on that project! |
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
bytearraysatisfybytes. Taking the suggestion from #707 resolved this in tests.Thank you for the library!