-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python bindings: make type annotations for CString and CBuffer less m…
…agical In order to avoid having magical types that only exist during type-checking, define CString and CBytes in the main _pathrs module and import them into the _libpathrs_cffi type stubs. Unfortunately, the straight-forward way of doing this (using a TypeAlias of _libpathrs_cffi.ffi.CData) doesn't work for some reason so we need to do a little bit of magic when TYPE_CHECKING to make mypy happy. But at least this is a little bit less magical than the previous version (where some variables only existed when type-checking). Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
- Loading branch information
Showing
2 changed files
with
18 additions
and
8 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