pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.06k stars 233 forks source link

Mypy bindings part 2 #717

Closed DMRobertson closed 2 years ago

DMRobertson commented 2 years ago

Only one surprise here in c5fe5d32921c0f62cd5ca3ca0fb68d14bd950251. To quote from its commit message:

Mypy couldn't see that state.tagbuf is not None in crypto_secretstream_xchacha20poly1305_pull, so I used a cast. I think it's correct to treat this as an Optional[bytes], because the docstrings mark many cffi unsigned char[] types as bytes. I'd appreciate a sanity check though!

In particular I'm not familiar with the mechanics of CFFI: My understanding is that the buffer objects it handles aren't regular bytes objects per-se, so I don't know if c5fe5d32921c0f62cd5ca3ca0fb68d14bd950251 is sound.

Alternatively, we could

DMRobertson commented 2 years ago

Codecov is unhappy, but I'm not sure how to interpret its output

reaperhulk commented 2 years ago

This should be interpreted as codecov being bad. When I look at the commit it shows 100% as expected.