Skip to content

Conversation

blast-hardcheese
Copy link

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 satisfy bytes. Taking the suggestion from #707 resolved this in tests.

Thank you for the library!

@blast-hardcheese blast-hardcheese force-pushed the secretbox-bytearray branch 3 times, most recently from d39a50d to 7e60497 Compare November 12, 2024 20:20
@blast-hardcheese
Copy link
Author

Please pardon the force pushes. I'm also happy to remove mypy from optional-dependencies.tests if desired.

I was able to use uv to do most of my iteration here, but not having an explicit version of mypy specified prevented typechecking locally.

@reaperhulk
Copy link
Member

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

@blast-hardcheese
Copy link
Author

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?

@reaperhulk
Copy link
Member

Yes, this pattern is correct for any immutable buffers being passed into the C layer.

@reaperhulk
Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

3 participants