-
Notifications
You must be signed in to change notification settings - Fork 42
Python Stubs
MatejKastak edited this page Mar 3, 2023
·
3 revisions
- type definitions for Python are stored in
src/python/typings/__init__.pyi - they are included in the distribution package
- bindings were initially generated using stubgen tool
stubgen -m yaramod- it looks like that we can also generate stubs using pyright
pyright --createstub yaramod- comparing the output of both tools, I think I like the
stubgenmore
- typing stubs must be updated manually
- you can use
stubgenorpyrightto generate a reference file - from this file you can then adopt some relevant parts, but the generated output should not be used directly
- currently we have a test setup that ensures that the file with stubs is valid
- however, it does not ensure that the stubs are correct