-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type annotations for
nacl.encoding
(#695)
* Type annotations for `nacl.encoding` Pulled out from #692. After we realised in #693 that we don't need `typing_extensions` to use `SupportsBytes`, I didn't want to pull in `typing_extensions` again for just one use of `Protocol`. (I have no other plans to use `Protocol` in other annotations.) My understanding: doing so means that we can't run `mypy` under Python 3.6 or 3.7 to fully typecheck the package. Maybe that's fine? I guess the downside is that someone using `nacl` in a 3.6 or 3.7 project can't fully benefit from these annotations. What're your thoughts here? (As a compromise, I could do a `try-except` dance to use from `typing_extensions.Protocol`, if it happens to be available.) * Use an ABC instead of a protocol * Format with black * Docstrings to appease the `coverage` check
- Loading branch information
1 parent
7367715
commit c2ddf9f
Showing
2 changed files
with
45 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters